Tabnine Logo
AbstractArchiveEntryFile
Code IndexAdd Tabnine to your IDE (free)

How to use
AbstractArchiveEntryFile
in
com.mucommander.commons.file.archive

Best Java code snippets using com.mucommander.commons.file.archive.AbstractArchiveEntryFile (Showing top 8 results out of 315)

origin: mucommander/mucommander

@Override
public void changePermission(PermissionAccess access, PermissionType permission, boolean enabled) throws IOException, UnsupportedFileOperationException {
  changePermissions(ByteUtils.setBit(getPermissions().getIntValue(), (permission.toInt() << (access.toInt()*3)), enabled));
}
origin: mucommander/mucommander

/**
 * Returns the contents of the specified folder entry.
 *
 * @throws UnsupportedFileOperationException if {@link FileOperation#READ_FILE} operations are not supported by the
 * underlying file protocol.
 */
protected AbstractFile[] ls(AbstractArchiveEntryFile entryFile, FilenameFilter filenameFilter, FileFilter fileFilter) throws IOException, UnsupportedFileOperationException {
  // Make sure the entries tree is created and up-to-date
  checkEntriesTree();        
  if(!entryFile.isBrowsable())
    throw new IOException();
  DefaultMutableTreeNode matchNode = entryTreeRoot.findEntryNode(entryFile.getEntry().getPath());
  if(matchNode==null)
    throw new IOException();
  return ls(matchNode, entryFile, filenameFilter, fileFilter);
}
origin: mucommander/mucommander

/**
 * This method is overridden to use the archive file's canonical path as the base path of this entry file.
 */
@Override
public String getCanonicalPath() {
  // Use the archive file's canonical path and append the entry's relative path to it
  return archiveFile.getCanonicalPath(true)+getRelativeEntryPath();
}
origin: mucommander/mucommander

/**
 * Returns the relative path of this entry, with respect to the archive file. The path separator of the returned
 * path is the one returned by {@link #getSeparator()}. As a relative path, the returned path does not start
 * with a separator character.
 *
 * @return the relative path of this entry, with respect to the archive file.
 */
public String getRelativeEntryPath() {
  String path = entry.getPath();
  // Replace all occurrences of the entry's separator by the archive file's separator, only if the separator is
  // not "/" (i.e. the entry path separator).
  String separator = getSeparator();
  if(!separator.equals("/"))
    path = path.replace("/", separator);
  return path;
}
origin: mucommander/mucommander

/**
 * Convenience method that returns the parent {@link AbstractArchiveFile} that contains this file. If this file
 * is an {@link AbstractArchiveFile} or an ancestor of {@link AbstractArchiveFile}, <code>this</code> is returned.
 * If this file is neither contained by an archive nor is an archive, <code>null</code> is returned.
 *
 * <p>
 * <b>Important note:</b> the returned {@link AbstractArchiveFile}, if any, may not necessarily be an
 * archive, as specified by {@link #isArchive()}. This is the case for files that were resolved as
 * {@link AbstractArchiveFile} instances based on their path, but that do not yet exist or were created as
 * directories. On the contrary, an existing archive will necessarily return a non-null value.
 * </p>
 *
 * @return the parent {@link AbstractArchiveFile} that contains this file
 */
public final AbstractArchiveFile getParentArchive() {
  if(hasAncestor(AbstractArchiveFile.class))
    return getAncestor(AbstractArchiveFile.class);
  else if(hasAncestor(AbstractArchiveEntryFile.class))
    return getAncestor(AbstractArchiveEntryFile.class).getArchiveFile();
  return null;
}
origin: mucommander/mucommander

  );
entryFile.setParent(parentFile);
origin: mucommander/mucommander

List<ArchiveEntry> selectedEntries = new Vector<ArchiveEntry>();
for(int i=0; i<nbFiles; i++) {
  selectedEntries.add((ArchiveEntry)files.elementAt(i).getAncestor(AbstractArchiveEntryFile.class).getUnderlyingFileObject());
origin: mucommander/mucommander

/**
 * This method is overridden to use the archive file's absolute path as the base path of this entry file.
 */
@Override
public String getAbsolutePath() {
  // Use the archive file's absolute path and append the entry's relative path to it
  return archiveFile.getAbsolutePath(true)+getRelativeEntryPath();
}
com.mucommander.commons.file.archiveAbstractArchiveEntryFile

Javadoc

AbstractArchiveEntryFile represents a file entry inside an archive. An AbstractArchiveEntryFile is always associated with an ArchiveEntry object which contains information about the entry (name, size, date, ...) and with an AbstractArchiveFile which acts as an entry repository and provides operations such as listing a directory entry's files, adding or removing entries (if the archive is writable), etc...

AbstractArchiveEntryFile implements com.mucommander.commons.file.AbstractFile by delegating methods to the ArchiveEntry and AbstractArchiveFile instances. AbstractArchiveEntryFile is agnostic to the actual archive format. In other words, there is no need to extend this class for a particular archive format, ArchiveEntry and AbstractArchiveFile provide a generic framework that isolates from the archive format's specifics.

This class is abstract (as the name implies) and implemented by two subclasses:

  • ROArchiveEntryFile: represents an entry inside a read-only archive
  • RWArchiveEntryFile: represents an entry inside a AbstractArchiveFile#isWritable() archive

Most used methods

  • changePermissions
  • getArchiveFile
    Returns the AbstractArchiveFile that contains the entry represented by this file.
  • getEntry
    Returns the ArchiveEntry instance that contains information about the archive entry (path, size, dat
  • getPermissions
  • getRelativeEntryPath
    Returns the relative path of this entry, with respect to the archive file. The path separator of the
  • getSeparator
    This method is overridden to return the separator of the #getArchiveFile() that contains this entry.
  • getUnderlyingFileObject
    Returns the same ArchiveEntry instance as #getEntry().
  • isBrowsable
  • setParent

Popular in Java

  • Running tasks concurrently on multiple threads
  • getSupportFragmentManager (FragmentActivity)
  • onRequestPermissionsResult (Fragment)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • Font (java.awt)
    The Font class represents fonts, which are used to render text in a visible way. A font provides the
  • File (java.io)
    An "abstract" representation of a file system entity identified by a pathname. The pathname may be a
  • SecureRandom (java.security)
    This class generates cryptographically secure pseudo-random numbers. It is best to invoke SecureRand
  • GregorianCalendar (java.util)
    GregorianCalendar is a concrete subclass of Calendarand provides the standard calendar used by most
  • Options (org.apache.commons.cli)
    Main entry-point into the library. Options represents a collection of Option objects, which describ
  • Logger (org.slf4j)
    The org.slf4j.Logger interface is the main user entry point of SLF4J API. It is expected that loggin
  • CodeWhisperer alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now