Lines 14-19
Link Here
|
14 |
* Contributors: |
14 |
* Contributors: |
15 |
* {Name} (company) - description of contribution. |
15 |
* {Name} (company) - description of contribution. |
16 |
* Xuan Chen (IBM) - [192741] [Archives] Move a folder from within an Archive doesn't work if > 1 level deep |
16 |
* Xuan Chen (IBM) - [192741] [Archives] Move a folder from within an Archive doesn't work if > 1 level deep |
|
|
17 |
* Xuan Chen (IBM) - [194293] [Local][Archives] Saving file second time in an Archive Errors |
17 |
*******************************************************************************/ |
18 |
*******************************************************************************/ |
18 |
|
19 |
|
19 |
package org.eclipse.rse.services.clientserver.archiveutils; |
20 |
package org.eclipse.rse.services.clientserver.archiveutils; |
Lines 907-916
Link Here
|
907 |
for (int i = 0; i < numFiles; i++) |
908 |
for (int i = 0; i < numFiles; i++) |
908 |
{ |
909 |
{ |
909 |
if (!files[i].exists() || !files[i].canRead()) return false; |
910 |
if (!files[i].exists() || !files[i].canRead()) return false; |
910 |
if (exists(virtualPath + "/" + names[i])) //$NON-NLS-1$ |
911 |
String fullVirtualName = getFullVirtualName(virtualPath, names[i]); |
|
|
912 |
if (exists(fullVirtualName)) |
911 |
{ |
913 |
{ |
912 |
// sorry, wrong method buddy |
914 |
// sorry, wrong method buddy |
913 |
return replace(virtualPath + "/" + names[i], files[i], names[i]); //$NON-NLS-1$ |
915 |
return replace(fullVirtualName, files[i], names[i]); |
914 |
} |
916 |
} |
915 |
} |
917 |
} |
916 |
File outputTempFile; |
918 |
File outputTempFile; |
Lines 2184-2193
Link Here
|
2184 |
virtualPath = ArchiveHandlerManager.cleanUpVirtualPath(virtualPath); |
2186 |
virtualPath = ArchiveHandlerManager.cleanUpVirtualPath(virtualPath); |
2185 |
if (!file.isDirectory()) |
2187 |
if (!file.isDirectory()) |
2186 |
{ |
2188 |
{ |
2187 |
if (exists(virtualPath + "/" + name)) //$NON-NLS-1$ |
2189 |
String fullVirtualName = getFullVirtualName(virtualPath, name); |
|
|
2190 |
if (exists(fullVirtualName)) |
2188 |
{ |
2191 |
{ |
2189 |
// wrong method |
2192 |
return replace(fullVirtualName, file, name); |
2190 |
return replace(virtualPath + "/" + name, file, name); //$NON-NLS-1$ |
|
|
2191 |
} |
2193 |
} |
2192 |
else |
2194 |
else |
2193 |
{ |
2195 |
{ |
Lines 2237-2240
Link Here
|
2237 |
return add(sources, virtualPath, newNames, sourceEncodings, targetEncodings, isTexts); |
2239 |
return add(sources, virtualPath, newNames, sourceEncodings, targetEncodings, isTexts); |
2238 |
} |
2240 |
} |
2239 |
} |
2241 |
} |
|
|
2242 |
|
2243 |
/** |
2244 |
* Construct the full virtual name of a virtual file from its virtual path and name. |
2245 |
* @param virtualPath the virtual path of this virtual file |
2246 |
* @param name the name of this virtual file |
2247 |
* @return the full virtual name of this virtual file |
2248 |
*/ |
2249 |
private static String getFullVirtualName(String virtualPath, String name) |
2250 |
{ |
2251 |
String fullVirtualName = null; |
2252 |
if (virtualPath == null || virtualPath.length() == 0) |
2253 |
{ |
2254 |
fullVirtualName = name; |
2255 |
} |
2256 |
else |
2257 |
{ |
2258 |
fullVirtualName = virtualPath + "/" + name; //$NON-NLS-1$ |
2259 |
} |
2260 |
return fullVirtualName; |
2261 |
} |
2240 |
} |
2262 |
} |