public void fetchChanges() { getIOService().getFileSystem( URI.create( REPO_PLAYGROUND + "?fetch" ) ); active = true; }
protected void initializeFileSystem() { final URI fileSystemURI = spaces.resolveFileSystemURI(SpacesAPI.Scheme.GIT, SpacesAPI.DEFAULT_SPACE, "preferences"); try { Map<String, Object> options = new HashMap<>(); options.put("init", Boolean.TRUE); options.put("internal", Boolean.TRUE); fileSystem = ioService.newFileSystem(fileSystemURI, options); } catch (FileSystemAlreadyExistsException e) { fileSystem = ioService.getFileSystem(fileSystemURI); } }
protected void initializeFileSystem() { final URI fileSystemURI = spaces.resolveFileSystemURI(SpacesAPI.Scheme.GIT, SpacesAPI.DEFAULT_SPACE, "preferences"); try { Map<String, Object> options = new HashMap<>(); options.put("init", Boolean.TRUE); options.put("internal", Boolean.TRUE); fileSystem = ioService.newFileSystem(fileSystemURI, options); } catch (FileSystemAlreadyExistsException e) { fileSystem = ioService.getFileSystem(fileSystemURI); } }
@Override @PostConstruct public void init() throws FileException { repositoryRoot = new File(TEST_RESOURCES).toURI().toString(); ioService.getFileSystem( URI.create( repositoryRoot )); }
@Override public FileSystem getFileSystem(URI uri) throws IllegalArgumentException, FileSystemNotFoundException, ProviderNotFoundException, SecurityException { final FileSystem result = service.getFileSystem(uri); if (!authManager.authorize(toResource(new FileSystemMetadata(result)), getUser())) { throw new SecurityException(); } return result; }
private void initFileSystem() { try { fileSystem = ioService.newFileSystem(URI.create(VFS_ROOT_PATH), new Maps.Builder<String, Object>() .put("init", Boolean.TRUE) .put("internal", Boolean.TRUE) .build()); } catch (FileSystemAlreadyExistsException e) { fileSystem = ioService.getFileSystem(URI.create(VFS_ROOT_PATH)); } this.root = fileSystem.getRootDirectories().iterator().next(); } }
private void initializeFileSystem(final URI rootURI) { try { fileSystem = ioService.newFileSystem(rootURI, new HashMap<String, Object>() {{ put("init", Boolean.TRUE); put("internal", Boolean.TRUE); }}); } catch (FileSystemAlreadyExistsException e) { fileSystem = ioService.getFileSystem(rootURI); } } }
private FileSystem createFileSystem(final GitRepository repo) { FileSystem fs; URI uri = null; try { uri = URI.create(repo.getUri()); fs = newFileSystem(uri); } catch (final FileSystemAlreadyExistsException e) { fs = ioService.getFileSystem(uri); Object replaceIfExists = repo.getEnvironment().get("replaceIfExists"); if (replaceIfExists != null && Boolean.valueOf(replaceIfExists.toString())) { org.uberfire.java.nio.file.Path root = fs.getPath(null); ioService.delete(root); fs = newFileSystem(uri); } } catch (final Throwable ex) { throw new RuntimeException(ex); } return fs; }
@Override public FileSystem getFileSystem(URI uri) throws IllegalArgumentException, FileSystemNotFoundException, ProviderNotFoundException, SecurityException { final FileSystem result = service.getFileSystem(uri); if (!authManager.authorize(toResource(new FileSystemMetadata(result)), getUser())) { throw new SecurityException(); } return result; }
@Override public String execute(CliContext context) { WeldContainer container = context.getContainer(); IOService ioService = container.instance().select(IOService.class, new NamedLiteral("configIO")).get(); String upstream = context.getParameter("git-upstream"); String gitlocal = context.getParameter("git-local"); if (upstream == null || gitlocal == null) { return "No upstream ("+upstream+") or no local ("+gitlocal+") git repository info available"; } ioService.getFileSystem(URI.create(gitlocal+"?sync="+upstream+"&force=true")); return "Fetched successfully"; } }
protected void initFileSystem() { try { fileSystem = ioService.newFileSystem(spacesAPI.resolveFileSystemURI(SpacesAPI.Scheme.DEFAULT, SpacesAPI.DEFAULT_SPACE, "datasets"), new HashMap<String, Object>() {{ put("init", Boolean.TRUE); put("internal", Boolean.TRUE); }}); } catch (FileSystemAlreadyExistsException e) { fileSystem = ioService.getFileSystem(spacesAPI.resolveFileSystemURI(SpacesAPI.Scheme.DEFAULT, SpacesAPI.DEFAULT_SPACE, "datasets")); } this.root = fileSystem.getRootDirectories().iterator().next(); }
protected void initFileSystem() { try { fileSystem = ioService.newFileSystem(spacesAPI.resolveFileSystemURI(SpacesAPI.Scheme.DEFAULT, SpacesAPI.DEFAULT_SPACE, "datasets"), new HashMap<String, Object>() {{ put("init", Boolean.TRUE); put("internal", Boolean.TRUE); }}); } catch (FileSystemAlreadyExistsException e) { fileSystem = ioService.getFileSystem(spacesAPI.resolveFileSystemURI(SpacesAPI.Scheme.DEFAULT, SpacesAPI.DEFAULT_SPACE, "datasets")); } this.root = fileSystem.getRootDirectories().iterator().next(); }
@PostConstruct public void setup() { try { fileSystem = ioService.newFileSystem(URI.create("default://bpmn"), new HashMap<String, Object>() {{ put("init", Boolean.TRUE); put("internal", Boolean.TRUE); }}); } catch (final FileSystemAlreadyExistsException e) { fileSystem = ioService.getFileSystem(URI.create("default://bpmn")); } this.root = fileSystem.getRootDirectories().iterator().next(); ioService.write(root.resolve("file1.bpmn"), BpmnPersistence.getInstance().marshal(new ProcessNode())); saveAndRenameService.init(this); }
@PostConstruct public void setup() { try { fileSystem = ioService.newFileSystem(URI.create("default://bpmn"), new HashMap<String, Object>() {{ put("init", Boolean.TRUE); put("internal", Boolean.TRUE); }}); } catch (final FileSystemAlreadyExistsException e) { fileSystem = ioService.getFileSystem(URI.create("default://bpmn")); } this.root = fileSystem.getRootDirectories().iterator().next(); ioService.write(root.resolve("file1.bpmn"), BpmnPersistence.getInstance().marshal(new ProcessNode())); saveAndRenameService.init(this); }
public void initFileSystem() { try { fileSystem = ioService.newFileSystem(spaces.resolveFileSystemURI(SpacesAPI.Scheme.DEFAULT, SpacesAPI.DEFAULT_SPACE, "security"), new HashMap<String, Object>() {{ put("init", Boolean.TRUE); put("internal", Boolean.TRUE); }}); } catch (FileSystemAlreadyExistsException e) { fileSystem = ioService.getFileSystem(spaces.resolveFileSystemURI(SpacesAPI.Scheme.DEFAULT, SpacesAPI.DEFAULT_SPACE, "security")); } this.root = fileSystem.getRootDirectories().iterator().next(); }
private void mockIoService() { final String artifact = "existentModule"; final String uri = repository.getUri() + fileSystem.getSeparator() + artifact; final Path path = PathFactory.newPath(artifact, uri); doReturn(fileSystem).when(ioService).getFileSystem(any(URI.class)); doReturn(Paths.convert(path)).when(ioService).get(eq(uri)); doReturn(true).when(ioService).exists(eq(Paths.convert(path))); } }
@Test //See https://bugzilla.redhat.com/show_bug.cgi?id=1288132 public void testSingleBatchIndexExecution() throws InterruptedException { final Path path1 = getBasePath("infinispan/" + this.getClass().getSimpleName()).resolve("xxx"); ioService().write(path1, "xxx!"); setupCountDown(3); //Make multiple requests for the FileSystem. We should only have one batch index operation final URI fsURI = URI.create("git://infinispan/" + this.getClass().getSimpleName() + "/file1"); final FileSystem fs1 = ioService().getFileSystem(fsURI); assertNotNull(fs1); final FileSystem fs2 = ioService().getFileSystem(fsURI); assertNotNull(fs2); final FileSystem fs3 = ioService().getFileSystem(fsURI); assertNotNull(fs3); waitForCountDown(10000); assertEquals(1, getStartBatchCount()); } }
@Test //See https://bugzilla.redhat.com/show_bug.cgi?id=1288132 public void testSingleBatchIndexExecution() throws InterruptedException { final Path path1 = getBasePath(this.getClass().getSimpleName()).resolve("xxx"); ioService().write(path1, "xxx!"); setupCountDown(3); //Make multiple requests for the FileSystem. We should only have one batch index operation final URI fsURI = URI.create("git://" + this.getClass().getSimpleName() + "/file1"); final FileSystem fs1 = ioService().getFileSystem(fsURI); assertNotNull(fs1); final FileSystem fs2 = ioService().getFileSystem(fsURI); assertNotNull(fs2); final FileSystem fs3 = ioService().getFileSystem(fsURI); assertNotNull(fs3); waitForCountDown(5000); assertEquals(1, getStartBatchCount()); } }
@Test //See https://bugzilla.redhat.com/show_bug.cgi?id=1288132 public void testSingleBatchIndexExecution() throws InterruptedException { final Path path1 = getBasePath("elastic/"+this.getClass().getSimpleName()).resolve("xxx"); ioService().write(path1, "xxx!"); setupCountDown(3); //Make multiple requests for the FileSystem. We should only have one batch index operation final URI fsURI = URI.create("git://elastic/"+this.getClass().getSimpleName() + "/file1"); final FileSystem fs1 = ioService().getFileSystem(fsURI); assertNotNull(fs1); final FileSystem fs2 = ioService().getFileSystem(fsURI); assertNotNull(fs2); final FileSystem fs3 = ioService().getFileSystem(fsURI); assertNotNull(fs3); waitForCountDown(10000); assertEquals(1, getStartBatchCount()); } }
@Test //See https://bugzilla.redhat.com/show_bug.cgi?id=1288132 public void testSingleBatchIndexExecution() throws InterruptedException { final Path path1 = getBasePath(this.getClass().getSimpleName()).resolve("xxx"); ioService().write(path1, "xxx!"); setupCountDown(3); //Make multiple requests for the FileSystem. We should only have one batch index operation final URI fsURI = URI.create("git://" + this.getClass().getSimpleName() + "/file1"); final FileSystem fs1 = ioService().getFileSystem(fsURI); assertNotNull(fs1); final FileSystem fs2 = ioService().getFileSystem(fsURI); assertNotNull(fs2); final FileSystem fs3 = ioService().getFileSystem(fsURI); assertNotNull(fs3); waitForCountDown(5000); assertEquals(1, getStartBatchCount()); } }