@Override public void checkRestriction(String name, IObject obj) { choose().checkRestriction(name, obj); }
@RolesAllowed("user") public byte[] read(long position, int length) { errorIfNotLoaded(); sec.checkRestriction(BinaryAccessPolicy.NAME, file); byte[] rawBuf = new byte[length]; ByteBuffer buf = ByteBuffer.wrap(rawBuf); try { buffer.read(buf, position); } catch (IOException e) { if (log.isDebugEnabled()) { log.debug("Buffer could not be read.", e); } throw new ResourceError(e.getMessage()); } return rawBuf; }