@Override public void checkAccess( BitField<FsAccessOption> options, FsNodeName name, BitField<Access> types) throws IOException { controller.checkAccess(options, name, types); }
@Override public final void checkAccess(BitField<FsAccessOption> options, FsNodeName name, BitField<Access> types) throws IOException { controller.checkAccess(map(options), name, types); }
@Override @FsAssertion(atomic=YES, consistent=YES, isolated=YES, durable=NOT_APPLICABLE) public boolean canRead() { if (null != innerArchive) { try { innerArchive.getController().checkAccess( getAccessPreferences(), getNodeName(), READ_ACCESS); return true; } catch (IOException ex) { return false; } } return file.canRead(); }
@Override @FsAssertion(atomic=YES, consistent=YES, isolated=YES, durable=NOT_APPLICABLE) public boolean canWrite() { if (null != innerArchive) { try { innerArchive.getController().checkAccess( getAccessPreferences(), getNodeName(), WRITE_ACCESS); return true; } catch (IOException ex) { return false; } } return file.canWrite(); }
@Override @FsAssertion(atomic=YES, consistent=YES, isolated=YES, durable=NOT_APPLICABLE) public boolean canExecute() { if (null != innerArchive) { try { innerArchive.getController().checkAccess( getAccessPreferences(), getNodeName(), EXECUTE_ACCESS); return true; } catch (IOException ex) { return false; } } return file.canExecute(); }
/** * {@inheritDoc} * * @see <a href="#falsePositives">Detecting Archive Paths and False Positives</a> */ @Override @FsAssertion(atomic=YES, consistent=YES, isolated=YES, durable=NOT_APPLICABLE) public boolean exists() { // DONT test existance of getNodeName() in enclArchive because // it doesn't need to exist - see // http://java.net/jira/browse/TRUEZIP-136 . if (null != innerArchive) { try { innerArchive.getController().checkAccess( getAccessPreferences(), getNodeName(), NO_ACCESS); return true; } catch (IOException ex) { return false; } } return file.exists(); }
void checkAccess(final TPath path, final AccessMode... modes) throws IOException { final FsNodeName name = path.getNodeName(); final BitField<FsAccessOption> options = path.getAccessPreferences(); final BitField<Access> types = types(modes); getController().checkAccess(options, name, types); }
@Override public void checkAccess( final BitField<FsAccessOption> options, final FsNodeName name, final BitField<Access> types) throws IOException { try { controller.checkAccess(options, name, types); } catch (final ControlFlowException ex) { if (!name.isRoot() || null == findKeyException(ex)) throw ex; getParent().checkAccess( options, getModel() .getMountPoint() .getPath() .resolve(name) .getNodeName(), types); } }