List of usage examples for java.nio.channels FileChannel open
public static FileChannel open(Path path, OpenOption... options) throws IOException
From source file:org.polago.deployconf.DeployConfRunner.java
/** * Gets a DeploymentConfig instance from a Path. * * @param path the file to use//from w w w .j a v a 2 s.c om * @return a DeploymentConfig representation of the ReadableByteChannel * @throws Exception indicating error */ private DeploymentConfig getDeploymentConfigFromPath(Path path) throws Exception { ReadableByteChannel ch = FileChannel.open(path, StandardOpenOption.READ); InputStream is = Channels.newInputStream(ch); DeploymentReader reader = new DeploymentReader(is, getGroupManager()); DeploymentConfig result = reader.parse(); ch.close(); return result; }