Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 73285 Details for
Bug 194293
[Local][Archives] Saving file second time in an Archive Errors
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Fix for bug 194293
patch_194293_1.txt (text/plain), 6.49 KB, created by
Xuan Chen
on 2007-07-08 21:58:56 EDT
(
hide
)
Description:
Fix for bug 194293
Filename:
MIME Type:
Creator:
Xuan Chen
Created:
2007-07-08 21:58:56 EDT
Size:
6.49 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.rse.services >Index: clientserver/org/eclipse/rse/services/clientserver/archiveutils/ArchiveHandlerManager.java >=================================================================== >RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.services/clientserver/org/eclipse/rse/services/clientserver/archiveutils/ArchiveHandlerManager.java,v >retrieving revision 1.5 >diff -u -r1.5 ArchiveHandlerManager.java >--- clientserver/org/eclipse/rse/services/clientserver/archiveutils/ArchiveHandlerManager.java 5 Jun 2007 10:37:08 -0000 1.5 >+++ clientserver/org/eclipse/rse/services/clientserver/archiveutils/ArchiveHandlerManager.java 9 Jul 2007 01:53:57 -0000 >@@ -13,6 +13,7 @@ > * > * Contributors: > * {Name} (company) - description of contribution. >+ * Xuan Chen (IBM) - [194293] [Local][Archives] Saving file second time in an Archive Errors > *******************************************************************************/ > > package org.eclipse.rse.services.clientserver.archiveutils; >@@ -367,8 +368,23 @@ > String newPath = fullVirtualName; > if (j != -1) > { >- realPart = fullVirtualName.substring(0, j) + VIRTUAL_SEPARATOR; >- newPath = fullVirtualName.substring(j + VIRTUAL_SEPARATOR.length()); >+ try >+ { >+ realPart = fullVirtualName.substring(0, j) + VIRTUAL_SEPARATOR; >+ if (j + VIRTUAL_SEPARATOR.length() < fullVirtualName.length()) >+ { >+ newPath = fullVirtualName.substring(j + VIRTUAL_SEPARATOR.length()); >+ } >+ else >+ { >+ //This is the special case where fullVirtualName ends with VIRTUAL_SEPARATOR >+ newPath = ""; //$NON-NLS-1$ >+ } >+ } >+ catch (Exception e) >+ { >+ e.printStackTrace(); >+ } > } > // use only forward slash separator > newPath = newPath.replace('\\', '/'); >Index: clientserver/org/eclipse/rse/services/clientserver/archiveutils/SystemZipHandler.java >=================================================================== >RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.services/clientserver/org/eclipse/rse/services/clientserver/archiveutils/SystemZipHandler.java,v >retrieving revision 1.7 >diff -u -r1.7 SystemZipHandler.java >--- clientserver/org/eclipse/rse/services/clientserver/archiveutils/SystemZipHandler.java 5 Jul 2007 08:11:40 -0000 1.7 >+++ clientserver/org/eclipse/rse/services/clientserver/archiveutils/SystemZipHandler.java 9 Jul 2007 01:53:59 -0000 >@@ -14,6 +14,7 @@ > * Contributors: > * {Name} (company) - description of contribution. > * Xuan Chen (IBM) - [192741] [Archives] Move a folder from within an Archive doesn't work if > 1 level deep >+ * Xuan Chen (IBM) - [194293] [Local][Archives] Saving file second time in an Archive Errors > *******************************************************************************/ > > package org.eclipse.rse.services.clientserver.archiveutils; >@@ -907,10 +908,19 @@ > for (int i = 0; i < numFiles; i++) > { > if (!files[i].exists() || !files[i].canRead()) return false; >- if (exists(virtualPath + "/" + names[i])) //$NON-NLS-1$ >+ String fullVirtualName = null; >+ if (virtualPath == null || virtualPath.length() == 0) >+ { >+ fullVirtualName = names[i]; >+ } >+ else >+ { >+ fullVirtualName = virtualPath + "/" + names[i]; //$NON-NLS-1$ >+ } >+ if (exists(fullVirtualName)) > { > // sorry, wrong method buddy >- return replace(virtualPath + "/" + names[i], files[i], names[i]); //$NON-NLS-1$ >+ return replace(fullVirtualName, files[i], names[i]); > } > } > File outputTempFile; >@@ -2182,12 +2192,21 @@ > { > if (!_exists) return false; > virtualPath = ArchiveHandlerManager.cleanUpVirtualPath(virtualPath); >+ > if (!file.isDirectory()) > { >- if (exists(virtualPath + "/" + name)) //$NON-NLS-1$ >+ String fullVirtualName = null; >+ if (virtualPath == null || virtualPath.length() == 0) > { >- // wrong method >- return replace(virtualPath + "/" + name, file, name); //$NON-NLS-1$ >+ fullVirtualName = name; >+ } >+ else >+ { >+ fullVirtualName = virtualPath + "/" + name; //$NON-NLS-1$ >+ } >+ if (exists(fullVirtualName)) >+ { >+ return replace(fullVirtualName, file, name); > } > else > { >Index: clientserver/org/eclipse/rse/services/clientserver/archiveutils/SystemTarHandler.java >=================================================================== >RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.services/clientserver/org/eclipse/rse/services/clientserver/archiveutils/SystemTarHandler.java,v >retrieving revision 1.4 >diff -u -r1.4 SystemTarHandler.java >--- clientserver/org/eclipse/rse/services/clientserver/archiveutils/SystemTarHandler.java 5 Jun 2007 10:37:08 -0000 1.4 >+++ clientserver/org/eclipse/rse/services/clientserver/archiveutils/SystemTarHandler.java 9 Jul 2007 01:53:58 -0000 >@@ -13,6 +13,7 @@ > * > * Contributors: > * {Name} (company) - description of contribution. >+ * Xuan Chen (IBM) - [194293] [Local][Archives] Saving file second time in an Archive Errors > *******************************************************************************/ > > package org.eclipse.rse.services.clientserver.archiveutils; >@@ -1013,8 +1014,17 @@ > if (!file.isDirectory()) { > > // if it exists, call replace >- if (exists(virtualPath + "/" + name)) { //$NON-NLS-1$ >- return replace(virtualPath + "/" + name, file, name); //$NON-NLS-1$ >+ String fullVirtualName = null; >+ if (virtualPath == null || virtualPath.length() == 0) >+ { >+ fullVirtualName = name; >+ } >+ else >+ { >+ fullVirtualName = virtualPath + "/" + name; //$NON-NLS-1$ >+ } >+ if (exists(fullVirtualName)) { >+ return replace(fullVirtualName, file, name); > } > else { > File[] files = new File[1]; >@@ -1099,8 +1109,17 @@ > // if the entry already exists, then we should do a replace > // TODO (KM): should we simply replace and return? > // I think we should check each entry and replace or create for each one >- if (exists(virtualPath + "/" + names[i])) { //$NON-NLS-1$ >- return replace(virtualPath + "/" + names[i], files[i], names[i]); //$NON-NLS-1$ >+ String fullVirtualName = null; >+ if (virtualPath == null || virtualPath.length() == 0) >+ { >+ fullVirtualName = names[i]; >+ } >+ else >+ { >+ fullVirtualName = virtualPath + "/" + names[i]; //$NON-NLS-1$ >+ } >+ if (exists(fullVirtualName)) { >+ return replace(fullVirtualName, files[i], names[i]); > } > } >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 194293
:
73285
|
73679
|
73685