/** * This method is overridden to list and return the topmost entries contained by this archive. * The returned files are {@link AbstractArchiveEntryFile} instances. * * @return the topmost entries contained by this archive * @throws IOException if the archive entries could not be listed * @throws UnsupportedFileOperationException if {@link FileOperation#READ_FILE} operations are not supported by the * underlying file protocol. */ @Override public AbstractFile[] ls() throws IOException, UnsupportedFileOperationException { // Delegate to the ancestor if this file isn't actually an archive if(!isArchive()) return super.ls(); // Make sure the entries tree is created and up-to-date checkEntriesTree(); return ls(entryTreeRoot, this, null, null); }
/** * This method is overridden to list and return the topmost entries contained by this archive, filtering out * the ones that do not match the specified {@link FilenameFilter}. The returned files are {@link AbstractArchiveEntryFile} * instances. * * @param filter the FilenameFilter to be used to filter files out from the list, may be <code>null</code> * @return the topmost entries contained by this archive * @throws IOException if the archive entries could not be listed * @throws UnsupportedFileOperationException if {@link FileOperation#READ_FILE} operations are not supported by the * underlying file protocol. */ @Override public AbstractFile[] ls(FilenameFilter filter) throws IOException, UnsupportedFileOperationException { // Delegate to the ancestor if this file isn't actually an archive if(!isArchive()) return super.ls(filter); // Make sure the entries tree is created and up-to-date checkEntriesTree(); return ls(entryTreeRoot, this, filter, null); }
/** * This method is overridden to list and return the topmost entries contained by this archive, filtering out * the ones that do not match the specified {@link FileFilter}. The returned files are {@link AbstractArchiveEntryFile} instances. * * @param filter the FilenameFilter to be used to filter files out from the list, may be <code>null</code> * @return the topmost entries contained by this archive * @throws IOException if the archive entries could not be listed * @throws UnsupportedFileOperationException if {@link FileOperation#READ_FILE} operations are not supported by the * underlying file protocol. */ @Override public AbstractFile[] ls(FileFilter filter) throws IOException, UnsupportedFileOperationException { // Delegate to the ancestor if this file isn't actually an archive if(!isArchive()) return super.ls(filter); // Make sure the entries tree is created and up-to-date checkEntriesTree(); return ls(entryTreeRoot, this, null, filter); }
@Override protected void jobCompleted() { super.jobCompleted(); // If the destination files are located inside an archive, optimize the archive file AbstractArchiveFile archiveFile = baseDestFolder.getParentArchive(); if(archiveFile!=null && archiveFile.isArchive() && archiveFile.isWritable()) optimizeArchive((AbstractRWArchiveFile)archiveFile); // Unselect all files in the active table upon successful completion if(selectedEntries!=null) { ActionManager.performAction(UnmarkAllAction.Descriptor.ACTION_ID, getMainFrame()); } }
@Override protected void jobCompleted() { super.jobCompleted(); // If the source files are located inside an archive, optimize the archive file AbstractArchiveFile archiveFile = getBaseSourceFolder().getParentArchive(); if(archiveFile!=null && archiveFile.isArchive() && archiveFile.isWritable()) { while(true) { try { archiveToOptimize = ((AbstractRWArchiveFile)archiveFile); isOptimizingArchive = true; archiveToOptimize.optimizeArchive(); break; } catch(IOException e) { if(showErrorDialog(errorDialogTitle, Translator.get("error_while_optimizing_archive", archiveFile.getName()))==FileJobAction.RETRY) continue; break; } } isOptimizingArchive = true; } }
@Override protected void jobCompleted() { super.jobCompleted(); // If the source files are located inside an archive, optimize the archive file AbstractArchiveFile sourceArchiveFile = getBaseSourceFolder()==null?null:getBaseSourceFolder().getParentArchive(); if(sourceArchiveFile!=null && sourceArchiveFile.isArchive() && sourceArchiveFile.isWritable()) optimizeArchive((AbstractRWArchiveFile)sourceArchiveFile); // If the destination files are located inside an archive, optimize the archive file, only if the destination // archive is different from the source one AbstractArchiveFile destArchiveFile = baseDestFolder.getParentArchive(); if(destArchiveFile!=null && destArchiveFile.isArchive() && destArchiveFile.isWritable() && !(sourceArchiveFile!=null && destArchiveFile.equalsCanonical(sourceArchiveFile))) optimizeArchive((AbstractRWArchiveFile)destArchiveFile); // If this job corresponds to a file renaming in the same directory, select the renamed file // in the active table after this job has finished (and hasn't been cancelled) if(files.size()==1 && newName!=null && baseDestFolder.equalsCanonical(files.elementAt(0).getParent())) { // Resolve new file instance now that it exists: some remote files do not immediately update file attributes // after creation, we need to get an instance that reflects the newly created file attributes selectFileWhenFinished(FileFactory.getFile(baseDestFolder.getAbsolutePath(true)+newName)); } }
@Override protected void jobCompleted() { super.jobCompleted(); // If the destination files are located inside an archive, optimize the archive file AbstractArchiveFile archiveFile = baseDestFolder.getParentArchive(); if(archiveFile!=null && archiveFile.isArchive() && archiveFile.isWritable()) optimizeArchive((AbstractRWArchiveFile)archiveFile); // If this job corresponds to a 'local copy' of a single file and in the same directory, // select the copied file in the active table after this job has finished (and hasn't been cancelled) if(files.size()==1 && newName!=null && baseDestFolder.equalsCanonical(files.elementAt(0).getParent())) { // Resolve new file instance now that it exists: some remote files do not immediately update file attributes // after creation, we need to get an instance that reflects the newly created file attributes selectFileWhenFinished(FileFactory.getFile(baseDestFolder.getAbsolutePath(true)+newName)); } }