本文整理了Java中org.uberfire.java.nio.file.FileSystems.newFileSystem()
方法的一些代码示例,展示了FileSystems.newFileSystem()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。FileSystems.newFileSystem()
方法的具体详情如下:
包路径:org.uberfire.java.nio.file.FileSystems
类名称:FileSystems
方法名:newFileSystem
暂无
代码示例来源:origin: org.uberfire/backend-server
@Override
public FileSystem newFileSystem(final String uri, final Map<String, Object> env)
throws IllegalArgumentException, FileSystemAlreadyExistsException, ProviderNotFoundException {
final URI furi = URI.create(uri);
final org.uberfire.java.nio.file.FileSystem newFileSystem = FileSystems.newFileSystem(furi, env);
return new FileSystemImpl(asList(new Path[]{new PathImpl(furi.getPath(), uri)}));
}
代码示例来源:origin: org.uberfire/vfs-api
/**
* @throws IllegalArgumentException
* @throws ProviderNotFoundException
* @throws ServiceConfigurationError
* @throws IOException
* @throws SecurityException
* @see <a href="http://docs.oracle.com/javase/7/docs/api/java/nio/file/FileSystems.html#newFileSystem(java.nio.file.Path, java.lang.ClassLoader)">Original JavaDoc</a>
*/
public static FileSystem newFileSystem(final Path path, final ClassLoader loader)
throws IllegalArgumentException, ProviderNotFoundException, ServiceConfigurationError, IOException, SecurityException {
checkNotNull("path", path);
final Map<String, ?> env = emptyMap();
return newFileSystem(path.toUri(), env, null);
}
代码示例来源:origin: org.uberfire/uberfire-nio2-api
/**
* @throws IllegalArgumentException
* @throws ProviderNotFoundException
* @throws ServiceConfigurationError
* @throws IOException
* @throws SecurityException
* @see <a href="http://docs.oracle.com/javase/7/docs/api/java/nio/file/FileSystems.html#newFileSystem(java.nio.file.Path, java.lang.ClassLoader)">Original JavaDoc</a>
*/
public static FileSystem newFileSystem(final Path path,
final ClassLoader loader)
throws IllegalArgumentException, ProviderNotFoundException, ServiceConfigurationError, IOException, SecurityException {
checkNotNull("path",
path);
final Map<String, ?> env = emptyMap();
return newFileSystem(path.toUri(),
env,
null);
}
代码示例来源:origin: kiegroup/appformer
/**
* @throws IllegalArgumentException
* @throws ProviderNotFoundException
* @throws ServiceConfigurationError
* @throws IOException
* @throws SecurityException
* @see <a href="http://docs.oracle.com/javase/7/docs/api/java/nio/file/FileSystems.html#newFileSystem(java.nio.file.Path, java.lang.ClassLoader)">Original JavaDoc</a>
*/
public static FileSystem newFileSystem(final Path path,
final ClassLoader loader)
throws IllegalArgumentException, ProviderNotFoundException, ServiceConfigurationError, IOException, SecurityException {
checkNotNull("path",
path);
final Map<String, ?> env = emptyMap();
return newFileSystem(path.toUri(),
env,
null);
}
代码示例来源:origin: org.uberfire/vfs-api
/**
* @throws IllegalArgumentException
* @throws FileSystemAlreadyExistsException
* @throws ProviderNotFoundException
* @throws IOException
* @throws SecurityException
* @see <a href="http://docs.oracle.com/javase/7/docs/api/java/nio/file/FileSystems.html#newFileSystem(java.net.URI, java.util.Map)">Original JavaDoc</a>
*/
public static FileSystem newFileSystem(final URI uri, final Map<String, ?> env)
throws IllegalArgumentException, FileSystemAlreadyExistsException, ProviderNotFoundException,
IOException, SecurityException {
checkNotNull("uri", uri);
checkNotNull("env", env);
return newFileSystem(uri, env, null);
}
代码示例来源:origin: org.uberfire/uberfire-nio2-api
/**
* @throws IllegalArgumentException
* @throws FileSystemAlreadyExistsException
* @throws ProviderNotFoundException
* @throws IOException
* @throws SecurityException
* @see <a href="http://docs.oracle.com/javase/7/docs/api/java/nio/file/FileSystems.html#newFileSystem(java.net.URI, java.util.Map)">Original JavaDoc</a>
*/
public static FileSystem newFileSystem(final URI uri,
final Map<String, ?> env)
throws IllegalArgumentException, FileSystemAlreadyExistsException, ProviderNotFoundException,
IOException, SecurityException {
checkNotNull("uri",
uri);
checkNotNull("env",
env);
return newFileSystem(uri,
env,
null);
}
代码示例来源:origin: kiegroup/appformer
/**
* @throws IllegalArgumentException
* @throws FileSystemAlreadyExistsException
* @throws ProviderNotFoundException
* @throws IOException
* @throws SecurityException
* @see <a href="http://docs.oracle.com/javase/7/docs/api/java/nio/file/FileSystems.html#newFileSystem(java.net.URI, java.util.Map)">Original JavaDoc</a>
*/
public static FileSystem newFileSystem(final URI uri,
final Map<String, ?> env)
throws IllegalArgumentException, FileSystemAlreadyExistsException, ProviderNotFoundException,
IOException, SecurityException {
checkNotNull("uri",
uri);
checkNotNull("env",
env);
return newFileSystem(uri,
env,
null);
}
代码示例来源:origin: kiegroup/appformer
@Test
public void newFileSystemNull1() {
assertThatThrownBy(() -> FileSystems.newFileSystem(null, Collections.emptyMap()))
.isInstanceOf(IllegalArgumentException.class)
.hasMessage("Parameter named 'uri' should be not null!");
}
代码示例来源:origin: kiegroup/appformer
@Test
public void newFileSystemNull3() {
assertThatThrownBy(() -> FileSystems.newFileSystem((URI) null, null))
.isInstanceOf(IllegalArgumentException.class)
.hasMessage("Parameter named 'uri' should be not null!");
}
代码示例来源:origin: kiegroup/appformer
@Test
public void newFileSystemNull4() {
assertThatThrownBy(() -> FileSystems.newFileSystem((Path) null, null))
.isInstanceOf(IllegalArgumentException.class)
.hasMessage("Parameter named 'path' should be not null!");
}
代码示例来源:origin: kiegroup/appformer
@Test
public void newFileSystemNull5() {
assertThatThrownBy(() -> FileSystems.newFileSystem(URI.create("jgit:///test"), null, null))
.isInstanceOf(IllegalArgumentException.class)
.hasMessage("Parameter named 'env' should be not null!");
}
代码示例来源:origin: kiegroup/appformer
@Override
public FileSystem newFileSystem(final URI uri,
final Map<String, ?> env) throws IllegalArgumentException, FileSystemAlreadyExistsException, ProviderNotFoundException, IOException, SecurityException {
try {
final FileSystem fs = FileSystems.newFileSystem(uri,
env);
return registerFS(fs);
} catch (final FileSystemAlreadyExistsException ex) {
registerFS(FileSystems.getFileSystem(uri));
throw ex;
}
}
代码示例来源:origin: kiegroup/appformer
@Test
public void newFileSystemNull2() {
assertThatThrownBy(() -> FileSystems.newFileSystem(URI.create("jgit:///test"), null))
.isInstanceOf(IllegalArgumentException.class)
.hasMessage("Parameter named 'env' should be not null!");
}
代码示例来源:origin: kiegroup/appformer
@Test
public void newFileSystemNull6() {
assertThatThrownBy(() -> FileSystems.newFileSystem(null, null, null))
.isInstanceOf(IllegalArgumentException.class)
.hasMessage("Parameter named 'uri' should be not null!");
}
}
代码示例来源:origin: org.uberfire/uberfire-io
@BeforeClass
public static void setup() throws IOException {
path = CommonIOServiceDotFileTest.createTempDirectory();
// XXX this is shaky at best: FileSystemProviders bootstraps the JGit FS in a static initializer.
// if anything has referenced it before now, setting this system property will have no effect.
System.setProperty("org.uberfire.nio.git.dir",
path.getAbsolutePath());
System.out.println(".niogit: " + path.getAbsolutePath());
final URI newRepo = URI.create("git://antpathmatcher");
FileSystems.newFileSystem(newRepo,
new HashMap<String, Object>());
}
代码示例来源:origin: kiegroup/appformer
@BeforeClass
public static void setup() throws IOException {
path = CommonIOServiceDotFileTest.createTempDirectory();
// XXX this is shaky at best: FileSystemProviders bootstraps the JGit FS in a static initializer.
// if anything has referenced it before now, setting this system property will have no effect.
System.setProperty("org.uberfire.nio.git.dir",
path.getAbsolutePath());
System.out.println(".niogit: " + path.getAbsolutePath());
final URI newRepo = URI.create("git://antpathmatcher");
FileSystems.newFileSystem(newRepo,
new HashMap<String, Object>());
}
代码示例来源:origin: org.guvnor/guvnor-ala-source-git
final URI fsURI = URI.create("git://" + name);
try {
fileSystem = FileSystems.newFileSystem(fsURI,
new HashMap<String, Object>(env) {
代码示例来源:origin: org.kie.workbench.services/kie-wb-common-services-backend
FileSystems.getFileSystem(fs);
} catch (FileSystemNotFoundException e) {
FileSystems.newFileSystem(fs,
new HashMap<String, Object>());
代码示例来源:origin: org.guvnor/guvnor-ala-source-git
@Test
public void sourceCloneTest() throws Exception {
final URI uri = URI.create("git://tempx");
final FileSystem fs = FileSystems.newFileSystem(uri,
new HashMap<String, Object>() {{
put("init",
Boolean.TRUE);
put("internal",
Boolean.TRUE);
put("out-dir",
tempPath.getAbsolutePath());
}});
final UFLocal local = new UFLocal();
final GitRepository repository = (GitRepository) local.getRepository("tempx",
Collections.emptyMap());
final Source source = repository.getSource("master");
assertNotNull(source);
assertEquals(source.getPath().getFileSystem(),
fs);
}
}
代码示例来源:origin: org.kie.workbench/kie-wb-common-ala-source-git
@Test
public void sourceCloneTest() throws Exception {
final URI uri = URI.create("git://tempx");
final FileSystem fs = FileSystems.newFileSystem(uri,
new HashMap<String, Object>() {{
put("init",
Boolean.TRUE);
put("internal",
Boolean.TRUE);
put("out-dir",
tempPath.getAbsolutePath());
}});
final UFLocal local = new UFLocal();
final GitRepository repository = (GitRepository) local.getRepository("tempx",
Collections.emptyMap());
final Source source = repository.getSource("master");
assertNotNull(source);
assertEquals(source.getPath().getFileSystem(),
fs);
}
}
内容来源于网络,如有侵权,请联系作者删除!