Skip to content

Commit cd860ef

Browse files
FIle移動APIでNewPathに拡張子がない存在しないファイルが指定された場合の挙動調整
## 更新内容 * FIle移動APIでNewPathに拡張子がない存在しないファイルが指定された場合の挙動調整 * ログ削除
1 parent 2c868d1 commit cd860ef

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

dConnectDevicePlugin/dConnectDeviceHost/dConnectDeviceHost/Classes/profile/DPHostFileProfile.m

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,11 +166,13 @@ - (instancetype)init
166166
[response setErrorToInvalidRequestParameterWithMessage:@"Directory can not be specified; use Move Directory API instead."];
167167
return YES;
168168
}
169-
if (![sysFileMgr fileExistsAtPath:dstNewPath isDirectory:&isDirectory]) {
169+
BOOL isExtension = ([dstNewPath pathExtension] && [dstNewPath pathExtension].length > 0)?YES:NO;
170+
if (![sysFileMgr fileExistsAtPath:dstNewPath isDirectory:&isDirectory]
171+
&& !isExtension && !isDirectory) { //拡張子がない存在しないファイルが指定された場合
170172
[response setErrorToInvalidRequestParameterWithMessage:@"NewPath not exist."];
171173
return YES;
172174
} else if ([sysFileMgr fileExistsAtPath:dstNewPath isDirectory:&isDirectory]
173-
&& ![[dstNewPath pathExtension] isEqualToString:@""] && !forceOverwrite) {
175+
&& ![[dstNewPath pathExtension] isEqualToString:@""] && !forceOverwrite) {
174176
[response setErrorToInvalidRequestParameterWithMessage:@"NewPath File already exist."];
175177
return YES;
176178
} else if (isDirectory) {

dConnectSDK/dConnectSDKForIOS/DConnectSDK/Classes/DConnectFileManager.m

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -570,8 +570,6 @@ - (NSString *)createFileForPath:(NSString *)path contents:(NSData *)contents
570570
withIntermediateDirectories:YES
571571
attributes:nil
572572
error:&error];
573-
NSLog(@"fileURLWithPath:%@", [NSURL fileURLWithPath:path]);
574-
NSLog(@"URLByAppendingPathComponent:%@", [self.URL URLByAppendingPathComponent:path]);
575573
if (error) {
576574
DCLogW(@"Failed to create intermediate directories.");
577575
return nil;

0 commit comments

Comments
 (0)