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 75376 Details for
Bug 198046
[dstore] Cannot copy a folder into an archive file
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Updated fix according to Martin's comment.
patch_198046_1.txt (text/plain), 4.13 KB, created by
Xuan Chen
on 2007-08-04 11:42:44 EDT
(
hide
)
Description:
Updated fix according to Martin's comment.
Filename:
MIME Type:
Creator:
Xuan Chen
Created:
2007-08-04 11:42:44 EDT
Size:
4.13 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.rse.services.dstore >Index: miners/org/eclipse/rse/dstore/universal/miners/UniversalFileSystemMiner.java >=================================================================== >RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.services.dstore/miners/org/eclipse/rse/dstore/universal/miners/UniversalFileSystemMiner.java,v >retrieving revision 1.15 >diff -u -r1.15 UniversalFileSystemMiner.java >--- miners/org/eclipse/rse/dstore/universal/miners/UniversalFileSystemMiner.java 24 Jul 2007 16:55:14 -0000 1.15 >+++ miners/org/eclipse/rse/dstore/universal/miners/UniversalFileSystemMiner.java 4 Aug 2007 15:38:48 -0000 >@@ -19,6 +19,7 @@ > * Xuan Chen (IBM) - [191280] [dstore] Expand fails for folder "/folk" with 3361 children > * Kevin Doyle (IBM) - [195709] Windows Copying doesn't work when path contains space > * Kevin Doyle (IBM) - [196211] DStore Move tries rename if that fails copy/delete >+ * Xuan Chen (IBM) - [198046] [dstore] Cannot copy a folder into an archive file > *******************************************************************************/ > > package org.eclipse.rse.dstore.universal.miners; >@@ -26,6 +27,7 @@ > import java.io.IOException; > import java.io.InputStream; > import java.net.ServerSocket; >+import java.util.ArrayList; > import java.util.HashMap; > import java.util.Iterator; > import java.util.List; >@@ -228,6 +230,7 @@ > // if target is virtual or an archive, insert into an archive > AbsoluteVirtualPath vpath = getAbsoluteVirtualPath(targetFolder); > ISystemArchiveHandler handler = getArchiveHandlerFor(vpath.getContainingArchiveString()); >+ boolean result = true; > > if (handler == null) > { >@@ -237,6 +240,15 @@ > > File[] srcFiles = new File[numOfSources]; > String[] names = new String[numOfSources]; >+ ArrayList nonDirectoryArrayList = new ArrayList(); >+ ArrayList nonDirectoryNamesArrayList = new ArrayList(); >+ >+ String virtualContainer = ""; //$NON-NLS-1$ >+ >+ if (targetType.equals(IUniversalDataStoreConstants.UNIVERSAL_VIRTUAL_FOLDER_DESCRIPTOR)) >+ { >+ virtualContainer = vpath.getVirtualPart(); >+ } > > for (int i = 0; i < numOfSources; i++) > { >@@ -263,20 +275,45 @@ > VirtualChild child = shandler.getVirtualFile(svpath.getVirtualPart()); > srcFiles[i] = child.getExtractedFile(); > } >+ >+ //If this source file object is directory, we will call ISystemArchiveHandler#add(File ...) method to >+ //it and all its descendants into the archive file. >+ //If this source file object is not a directory, we will add it into a list, and then >+ //call ISystemArchiveHandler#add(File[] ...) to add them in batch. >+ if (srcFiles[i].isDirectory()) >+ { >+ result = handler.add(srcFiles[i], virtualContainer, names[i]); >+ if (result == false) { >+ status.setAttribute(DE.A_SOURCE, IServiceConstants.FAILED); >+ return statusDone(status); >+ } >+ } >+ else >+ { >+ nonDirectoryArrayList.add(srcFiles[i]); >+ nonDirectoryNamesArrayList.add(names[i]); >+ } > } >- String virtualContainer = ""; //$NON-NLS-1$ > >- if (targetType.equals(IUniversalDataStoreConstants.UNIVERSAL_VIRTUAL_FOLDER_DESCRIPTOR)) >+ if (nonDirectoryArrayList.size() > 0) > { >- virtualContainer = vpath.getVirtualPart(); >+ File[] resultFiles = new File[nonDirectoryArrayList.size()]; >+ String[] resultNames = new String[nonDirectoryNamesArrayList.size()]; >+ for (int i=0; i<nonDirectoryArrayList.size(); i++) >+ { >+ resultFiles[i] = (File)nonDirectoryArrayList.get(i); >+ resultNames[i] = (String)nonDirectoryNamesArrayList.get(i); >+ } >+ //we need to add those files into the archive file as well. >+ result = handler.add(resultFiles, virtualContainer, resultNames); > } >- >- boolean result = handler.add(srcFiles, virtualContainer, names); > >- if (result) { >+ if (true == result) >+ { > status.setAttribute(DE.A_SOURCE, IServiceConstants.SUCCESS); > } >- else { >+ else >+ { > status.setAttribute(DE.A_SOURCE, IServiceConstants.FAILED); > } > return statusDone(status);
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 198046
:
74891
| 75376 |
75426