@Override public void close() throws IOException { if (isClosed) { throw new IOException(); } isClosed = true; }
private String encodePath(final String s) { return EncodingUtil.encodePath(s); }
/** * Escape and encode a string regarded as the path component of an URI with * the default protocol charset. * @param unescaped an unescaped string * @return the escaped string */ public static String encodePath(String unescaped) { byte[] rawdata = URLCodec.encodeUrl(allowed_abs_path, getBytes(unescaped, "UTF-8")); return getAsciiString(rawdata); }
@Override public void close() throws IOException { if (isClosed) { throw new IOException("This stream is closed."); } isClosed = true; }
private String encodePath(final String s) { return EncodingUtil.encodePath(s); }
@Override public void close() throws IOException { if (isClosed) { throw new IOException("This stream is closed."); } isClosed = true; }
@Override public SeekableByteChannel truncate(final long size) throws IOException { try { channel.truncate(size); return this; } catch (java.io.IOException e) { throw new IOException(e); } }
@Override public void close() throws java.io.IOException { try { channel.close(); } catch (java.io.IOException e) { throw new IOException(e); } } }
@Override public long position() throws IOException { try { return channel.position(); } catch (java.io.IOException e) { throw new IOException(e); } }
@Override public long size() throws IOException { try { return channel.size(); } catch (java.io.IOException e) { throw new IOException(e); } }
@Override public int read(final ByteBuffer dst) throws java.io.IOException { try { return channel.read(dst); } catch (java.io.IOException e) { throw new IOException(e); } }
@Override public SeekableByteChannel position(final long newPosition) throws IOException { try { channel.position(newPosition); return this; } catch (java.io.IOException e) { throw new IOException(e); } }
@Override public int write(final ByteBuffer src) throws java.io.IOException { try { return channel.write(src); } catch (java.io.IOException e) { throw new IOException(e); } }
@Override public long position() throws IOException { try { return channel.position(); } catch (java.io.IOException e) { throw new IOException(e); } }
@Override public SeekableByteChannel position(final long newPosition) throws IOException { try { channel.position(newPosition); return this; } catch (java.io.IOException e) { throw new IOException(e); } }
@Override public SeekableByteChannel truncate(final long size) throws IOException { try { channel.truncate(size); return this; } catch (java.io.IOException e) { throw new IOException(e); } }
@Override public int read(final ByteBuffer dst) throws java.io.IOException { try { return channel.read(dst); } catch (java.io.IOException e) { throw new IOException(e); } }
@Override public int write(final ByteBuffer src) throws java.io.IOException { try { return channel.write(src); } catch (java.io.IOException e) { throw new IOException(e); } }
public void close() { try { directory.close(); } catch ( final IOException e ) { throw new org.uberfire.java.nio.IOException( e ); } }
@Override public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) throws IOException { preDir.addAndGet(1); if (preDir.get() > 1) { throw new IOException(); } return FileVisitResult.CONTINUE; }