import java.io.InputStream;
import java.util.ArrayList;
import java.util.List;
-import java.util.zip.ZipEntry;
-import org.eclipse.ui.internal.wizards.datatransfer.TarEntry;
+import org.apache.commons.compress.archivers.tar.TarArchiveEntry;
+import org.apache.commons.compress.archivers.zip.ZipArchiveEntry;
import org.eclipse.ui.wizards.datatransfer.IImportStructureProvider;
/**
* An import provider that makes use of the IFileSystemObject abstraction
- * instead of using plain file system objects (File, TarEntry, ZipEntry, etc)
+ * instead of using plain file system objects (File, TarArchiveEntry, ZipArchiveEntry, etc)
*/
-@SuppressWarnings("restriction")
public class FileSystemObjectImportStructureProvider implements IImportStructureProvider {
private IImportStructureProvider fImportProvider;
private String fArchivePath;
- FileSystemObjectImportStructureProvider(IImportStructureProvider importStructureProvider, String archivePath) {
+ /**
+ * Constructor
+ *
+ * @param importStructureProvider
+ * the {@link IImportStructureProvider}
+ * @param archivePath
+ * the path of the archive file
+ */
+ public FileSystemObjectImportStructureProvider(IImportStructureProvider importStructureProvider, String archivePath) {
fImportProvider = importStructureProvider;
fArchivePath = archivePath;
}
for (Object o : children) {
adapted.add(getIFileSystemObject(o));
}
+
return adapted;
}
if (o instanceof File) {
return new FileFileSystemObject((File) o);
- } else if (o instanceof TarEntry) {
- return new TarFileSystemObject((TarEntry) o, fArchivePath);
- } else if (o instanceof ZipEntry) {
- return new ZipFileSystemObject((ZipEntry) o, fArchivePath);
+ } else if (o instanceof TarArchiveEntry) {
+ return new TarFileSystemObject((TarArchiveEntry) o, fArchivePath);
+ } else if (o instanceof ZipArchiveEntry) {
+ return new ZipFileSystemObject((ZipArchiveEntry) o, fArchivePath);
} else if (o instanceof GzipEntry) {
return new GzipFileSystemObject((GzipEntry) o, fArchivePath);
}