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 149468 Details for
Bug 278402
[Import/Export] Export project does not export empty folders
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
ExportArchiveFileOperationTest patch v1
bug278402-patch-v2.txt (text/plain), 3.55 KB, created by
Remy Suen
on 2009-10-13 15:28:35 EDT
(
hide
)
Description:
ExportArchiveFileOperationTest patch v1
Filename:
MIME Type:
Creator:
Remy Suen
Created:
2009-10-13 15:28:35 EDT
Size:
3.55 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.ui.tests >Index: Eclipse UI Tests/org/eclipse/ui/tests/datatransfer/ExportArchiveFileOperationTest.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/datatransfer/ExportArchiveFileOperationTest.java,v >retrieving revision 1.5 >diff -u -r1.5 ExportArchiveFileOperationTest.java >--- Eclipse UI Tests/org/eclipse/ui/tests/datatransfer/ExportArchiveFileOperationTest.java 8 Oct 2009 06:50:45 -0000 1.5 >+++ Eclipse UI Tests/org/eclipse/ui/tests/datatransfer/ExportArchiveFileOperationTest.java 13 Oct 2009 19:29:20 -0000 >@@ -371,35 +371,30 @@ > assertTrue(fileName + " does not appear to be compressed.", compressed); > } > >- private void verifyFolders(int folderCount, String type){ >- try{ >- List allEntries = new ArrayList(); >- if (ZIP_FILE_EXT.equals(type)){ >- ZipFile zipFile = new ZipFile(filePath); >- Enumeration entries = zipFile.entries(); >- while (entries.hasMoreElements()){ >- ZipEntry entry = (ZipEntry)entries.nextElement(); >- allEntries.add(entry.getName()); >- } >- zipFile.close(); >- } >- else{ >- TarFile tarFile = new TarFile(filePath); >- Enumeration entries = tarFile.entries(); >- while (entries.hasMoreElements()){ >- TarEntry entry = (TarEntry)entries.nextElement(); >- allEntries.add(entry.getName()); >- } >- tarFile.close(); >- } >- if (flattenPaths) >- verifyFiles(allEntries); >- else >- verifyArchive(folderCount, allEntries); >+ private void verifyFolders(int folderCount, String type) throws Exception { >+ List allEntries = new ArrayList(); >+ if (ZIP_FILE_EXT.equals(type)){ >+ ZipFile zipFile = new ZipFile(filePath); >+ Enumeration entries = zipFile.entries(); >+ while (entries.hasMoreElements()){ >+ ZipEntry entry = (ZipEntry)entries.nextElement(); >+ allEntries.add(entry.getName()); >+ } >+ zipFile.close(); > } >- catch (Exception e){ >- fail(e.getMessage()); >+ else{ >+ TarFile tarFile = new TarFile(filePath); >+ Enumeration entries = tarFile.entries(); >+ while (entries.hasMoreElements()){ >+ TarEntry entry = (TarEntry)entries.nextElement(); >+ allEntries.add(entry.getName()); >+ } >+ tarFile.close(); > } >+ if (flattenPaths) >+ verifyFiles(allEntries); >+ else >+ verifyArchive(folderCount, allEntries); > } > > private void verifyArchive(int folderCount, List entries){ >@@ -409,9 +404,17 @@ > Iterator archiveEntries = entries.iterator(); > while (archiveEntries.hasNext()){ > String entryName = (String)archiveEntries.next(); >- int idx = entryName.lastIndexOf("/"); >- String folderPath = entryName.substring(0, idx); >- String fileName = entryName.substring(idx+1, entryName.length()); >+ // find the path separator at the end of this string >+ int backIdx = entryName.lastIndexOf("/"); >+ int forwardIdx = entryName.lastIndexOf("\\"); >+ int index = backIdx; >+ if (backIdx == -1) { >+ index = forwardIdx; >+ } else if (forwardIdx != -1) { >+ index = backIdx > forwardIdx ? backIdx : forwardIdx; >+ } >+ String folderPath = entryName.substring(0, index); >+ String fileName = entryName.substring(index+1, entryName.length()); > // we get empty strings for folder entries, don't add them as a file name > if (fileName.length() != 0) { > files.add(fileName);
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 278402
:
137765
|
149468
|
188350
|
192850