Codota Logo
AbstractArchiveEntryFile
Code IndexAdd Codota 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)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
StringBuilder s =
  • Codota Iconnew StringBuilder()
  • Codota Iconnew StringBuilder(32)
  • Codota IconString str;new StringBuilder(str)
  • Smart code suggestions by Codota
}
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

  • Reading from database using SQL prepared statement
  • onRequestPermissionsResult (Fragment)
  • getExternalFilesDir (Context)
  • setScale (BigDecimal)
    Returns a BigDecimal whose scale is the specified value, and whose value is numerically equal to thi
  • BufferedImage (java.awt.image)
    The BufferedImage subclass describes an java.awt.Image with an accessible buffer of image data. All
  • BufferedReader (java.io)
    Reads text from a character-input stream, buffering characters so as to provide for the efficient re
  • PrintStream (java.io)
    A PrintStream adds functionality to another output stream, namely the ability to print representatio
  • Date (java.util)
    A specific moment in time, with millisecond precision. Values typically come from System#currentTime
  • ResourceBundle (java.util)
    Resource bundles contain locale-specific objects. When your program needs a locale-specific resource
  • TimerTask (java.util)
    A task that can be scheduled for one-time or repeated execution by a Timer.
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now