@Override public boolean isDirectory() { return entry.isDirectory(); }
/** * Returns the file permissions of this entry. This method is overridden to return default permissions * ({@link FilePermissions#DEFAULT_DIRECTORY_PERMISSIONS} for directories, {@link FilePermissions#DEFAULT_FILE_PERMISSIONS} * for regular files), when none have been set. * * @return the file permissions of this entry */ @Override public FilePermissions getPermissions() { FilePermissions permissions = super.getPermissions(); if(permissions==null) return isDirectory()?FilePermissions.DEFAULT_DIRECTORY_PERMISSIONS:FilePermissions.DEFAULT_FILE_PERMISSIONS; return permissions; }
DefaultMutableTreeNode node = this; for(int d=1; d<=entryDepth; d++) { if(d==entryDepth && !entry.isDirectory()) {
/** * Creates and returns a {@link com.mucommander.commons.file.archive.zip.provider.ZipEntry} instance using the attributes * of the given {@link ArchiveEntry}. * * @param entry the object that serves to initialize the attributes of the returned ZipEntry * @return a ZipEntry whose attributes are fetched from the given ZipEntry */ private ZipEntry createZipEntry(ArchiveEntry entry) { boolean isDirectory = entry.isDirectory(); String path = entry.getPath(); if(isDirectory && !path.endsWith("/")) path += "/"; com.mucommander.commons.file.archive.zip.provider.ZipEntry zipEntry = new com.mucommander.commons.file.archive.zip.provider.ZipEntry(path); zipEntry.setMethod(ZipConstants.DEFLATED); zipEntry.setTime(System.currentTimeMillis()); zipEntry.setUnixMode(SimpleFilePermissions.padPermissions(entry.getPermissions(), isDirectory ? FilePermissions.DEFAULT_DIRECTORY_PERMISSIONS : FilePermissions.DEFAULT_FILE_PERMISSIONS).getIntValue()); return zipEntry; }
@Override public InputStream getEntryInputStream(ArchiveEntry entry, ArchiveEntryIterator entryIterator) throws IOException, UnsupportedFileOperationException { if(entry.isDirectory()) throw new IOException();
if(selectedEntry.isDirectory()) { if(entryPath.startsWith(selectedEntry.getPath())) { processEntry = true;