Tabnine Logo
FsController.node
Code IndexAdd Tabnine to your IDE (free)

How to use
node
method
in
net.java.truevfs.kernel.spec.FsController

Best Java code snippets using net.java.truevfs.kernel.spec.FsController.node (Showing top 17 results out of 315)

origin: net.java.truevfs/truevfs-kernel-spec

@Override
public @CheckForNull FsNode node(
    BitField<FsAccessOption> options,
    FsNodeName name)
throws IOException {
  return controller.node(options, name);
}
origin: net.java.truevfs/truevfs-kernel-spec

@Override
public final FsNode node(BitField<FsAccessOption> options, FsNodeName name) throws IOException {
  return controller.node(map(options), name);
}
origin: net.java.truevfs/truevfs-access

try {
  entry = innerArchive.getController()
      .node(getAccessPreferences(), getNodeName());
} catch (IOException ex) {
  return null;
origin: net.java.truevfs/truevfs-access

FsNode stat(TPath path) throws IOException {
  return getController().node(path.getAccessPreferences(), path.getNodeName());
}
origin: net.java.truevfs/truevfs-access

try {
  entry = innerArchive.getController()
      .node(getAccessPreferences(), getNodeName());
} catch (IOException ex) {
  return null;
origin: net.java.truevfs/truevfs-access

FsNodeAttributes(final TPath path) throws IOException {
  if (null == (entry = getController()
      .node(path.getAccessPreferences(), path.getNodeName())))
    throw new NoSuchFileException(path.toString());
}
origin: net.java.truevfs/truevfs-access

/**
 * Similar to its super class implementation, but returns
 * {@code false} for a valid archive file, too.
 * <p>
 * For archive file validation its virtual file system gets mounted.
 * In case a RAES encrypted ZIP file gets mounted, the user gets prompted
 * for its password unless the default configuration for key management
 * hasn't been overridden.
 *
 * @see <a href="#falsePositives">Detecting Archive Paths and False Positives</a>
 */
@Override
@FsAssertion(atomic=YES, consistent=YES, isolated=YES, durable=NOT_APPLICABLE)
public boolean isFile() {
  if (null != innerArchive) {
    try {
      final FsNode entry = innerArchive.getController()
          .node(getAccessPreferences(), getNodeName());
      return null != entry && entry.isType(FILE);
    } catch (IOException ex) {
      return false;
    }
  }
  return file.isFile();
}
origin: net.java.truevfs/truevfs-access

/**
 * {@inheritDoc}
 * <p>
 * Note that archive entries with absolute paths are ignored by this
 * method and are never returned.
 */
@Override
@FsAssertion(atomic=YES, consistent=YES, isolated=YES, durable=NOT_APPLICABLE)
public @Nullable TFile[] listFiles(final @CheckForNull FileFilter filter) {
  if (null != innerArchive) {
    final FsNode entry;
    try {
      entry = innerArchive.getController()
          .node(getAccessPreferences(), getNodeName());
    } catch (IOException ex) {
      return null;
    }
    return filter(members(entry), filter);
  } else {
    return filter(list(file.list()), filter);
  }
}
origin: net.java.truevfs/truevfs-access

/**
 * Similar to its super class implementation, but returns
 * {@code true} for a valid archive file, too.
 * <p>
 * For archive file validation its virtual file system gets mounted.
 * In case a RAES encrypted ZIP file gets mounted, the user gets prompted
 * for its password unless the default configuration for key management
 * hasn't been overridden.
 *
 * @see <a href="#falsePositives">Detecting Archive Paths and False Positives</a>
 * @see #isArchive
 * @see #isEntry
 */
@Override
@FsAssertion(atomic=YES, consistent=YES, isolated=YES, durable=NOT_APPLICABLE)
public boolean isDirectory() {
  if (null != innerArchive) {
    try {
      final FsNode entry = innerArchive.getController()
          .node(getAccessPreferences(), getNodeName());
      return null != entry && entry.isType(DIRECTORY);
    } catch (IOException ex) {
      return false;
    }
  }
  return file.isDirectory();
}
origin: net.java.truevfs/truevfs-access

/**
 * Returns a {@code long} value representing the time this file was
 * last modified, measured in milliseconds since the epoch (00:00:00 GMT,
 * January 1, 1970), or {@code 0L} if the file does not exist or if an
 * I/O error occurs or if this is a ghost directory in an archive file.
 *
 * @see <a href="package.html">Package description for more information
 *      about ghost directories</a>
 */
@Override
@FsAssertion(atomic=YES, consistent=YES, isolated=YES, durable=NOT_APPLICABLE)
public long lastModified() {
  if (null != innerArchive) {
    final FsNode entry;
    try {
      entry = innerArchive.getController()
          .node(getAccessPreferences(), getNodeName());
    } catch (final IOException ex) {
      return 0;
    }
    if (null == entry)
      return 0;
    final long time = entry.getTime(Access.WRITE);
    return UNKNOWN != time ? time : 0;
  }
  return file.lastModified();
}
origin: net.java.truevfs/truevfs-access

/**
 * Returns the (uncompressed) length of the file.
 * The length returned of a valid archive file is {@code 0} in order
 * to properly emulate virtual directories across all platforms.
 * <p>
 * For archive file validation its virtual file system gets mounted.
 * In case a RAES encrypted ZIP file gets mounted, the user gets prompted
 * for its password unless the default configuration for key management
 * hasn't been overridden.
 *
 * @see <a href="#falsePositives">Detecting Archive Paths and False Positives</a>
 */
@Override
@FsAssertion(atomic=YES, consistent=YES, isolated=YES, durable=NOT_APPLICABLE)
public long length() {
  if (null != innerArchive) {
    final FsNode entry;
    try {
      entry = innerArchive.getController()
          .node(getAccessPreferences(), getNodeName());
    } catch (final IOException ex) {
      return 0;
    }
    if (null == entry)
      return 0;
    final long size = entry.getSize(Size.DATA);
    return UNKNOWN != size ? size : 0;
  }
  return file.length();
}
origin: net.java.truevfs/truevfs-access

/**
 * {@inheritDoc}
 * <p>
 * Note that archive entries with absolute paths are ignored by this
 * method and are never returned.
 */
@Override
@FsAssertion(atomic=YES, consistent=YES, isolated=YES, durable=NOT_APPLICABLE)
public @Nullable TFile[] listFiles(
    final @CheckForNull FilenameFilter filter) {
  if (null != innerArchive) {
    final FsNode entry;
    try {
      entry = innerArchive.getController()
          .node(getAccessPreferences(), getNodeName());
    } catch (IOException ex) {
      return null;
    }
    return filter(members(entry), filter);
  } else {
    return filter(list(file.list(filter)), (FilenameFilter) null);
  }
}
origin: net.java.truevfs/truevfs-access

void createDirectory(final TPath path, final FileAttribute<?>... attrs)
throws IOException {
  if (0 < attrs.length)
    throw new UnsupportedOperationException();
  final FsController controller = getController();
  final FsNodeName name = path.getNodeName();
  final BitField<FsAccessOption> options = path.getAccessPreferences();
  try {
    controller.make(
        options, name,
        DIRECTORY,
        null);
  } catch (IOException ex) {
    if (null != controller.node(options, name))
      throw (IOException) new FileAlreadyExistsException(path.toString())
          .initCause(ex);
    throw ex;
  }
}
origin: net.java.truevfs/truevfs-access

} catch (IOException ex) {
  final FsNode entry = controller
      .node(getAccessPreferences(), innerEntryName);
  if (null == entry || !entry.isType(DIRECTORY))
    throw ex;
origin: net.java.truevfs/truevfs-comp-zipdriver

throws IOException {
  try {
    return controller.node(options, name);
  } catch (final ControlFlowException ex) {
    if (!name.isRoot() || null == findKeyException(ex))
      throw ex;
    Entry node = getParent().node(
        options, getModel()
               .getMountPoint()
origin: net.java.truevfs/truevfs-comp-jmx

      .get()
      .controller(DRIVER, mp)
      .node(FsAccessOptions.NONE, en);
} catch (IOException ex) {
  node = null;
origin: net.java.truevfs/truevfs-access

SeekableByteChannel newByteChannel(
    final TPath path,
    final Set<? extends OpenOption> options,
    final FileAttribute<?>... attrs)
throws IOException {
  final FsNodeName name = path.getNodeName();
  final FsController controller = getController();
  if (options.isEmpty() || options.contains(StandardOpenOption.READ)) {
    final BitField<FsAccessOption>
        o = path.inputOptions(options).set(CACHE);
    return controller
        .input(o, name)
        .channel(null);
  } else {
    final BitField<FsAccessOption>
        o = path.outputOptions(options).set(CACHE);
    try {
      return controller
          .output(o, name, null)
          .channel(null);
    } catch (final IOException ex) {
      // TODO: Filter FileAlreadyExistsException.
      if (o.get(EXCLUSIVE) && null != controller.node(o, name))
        throw (IOException) new FileAlreadyExistsException(path.toString())
            .initCause(ex);
      throw ex;
    }
  }
}
net.java.truevfs.kernel.specFsControllernode

Javadoc

Returns the file system node for the given name or nullif it doesn't exist. Modifying the returned node does not show any effect on the file system and should result in an UnsupportedOperationException.

Popular methods of FsController

  • checkAccess
    Checks if the file system node for the given name exists when constrained by the given access option
  • getModel
    Returns the file system model.
  • output
    Returns an output socket for writing the contents of the node addressed by the given name to the fil
  • unlink
    Removes the named file system node from the file system. If the named file system node is a director
  • getParent
    Returns the controller for the parent file system or null if and only if this file system is not fed
  • input
    Returns an input socket for reading the contents of the file system node addressed by the given name
  • make
    Creates or replaces and finally links a chain of one or more entries for the given node name into th
  • setReadOnly
    Sets the named file system node as read-only. This method will fail for typical archive file system
  • setTime
    Makes an attempt to set the last access time of all types in the given bit field for the file system
  • sync
    Commits all unsynchronized changes to the contents of this file system to its parent file system, re

Popular in Java

  • Reactive rest calls using spring rest template
  • putExtra (Intent)
  • getSystemService (Context)
  • requestLocationUpdates (LocationManager)
  • Component (java.awt)
    A component is an object having a graphical representation that can be displayed on the screen and t
  • Point (java.awt)
    A point representing a location in (x,y) coordinate space, specified in integer precision.
  • EOFException (java.io)
    Thrown when a program encounters the end of a file or stream during an input operation.
  • Proxy (java.net)
    This class represents proxy server settings. A created instance of Proxy stores a type and an addres
  • Charset (java.nio.charset)
    A charset is a named mapping between Unicode characters and byte sequences. Every Charset can decode
  • Loader (org.hibernate.loader)
    Abstract superclass of object loading (and querying) strategies. This class implements useful common
  • Top Vim plugins
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