use of org.eclipse.che.api.vfs.VirtualFileSystem in project che by eclipse.
the class CreateBaseProjectTypeHandler method onCreateProject.
@Override
public void onCreateProject(Path projectPath, Map<String, AttributeValue> attributes, Map<String, String> options) throws ForbiddenException, ConflictException, ServerException {
VirtualFileSystem vfs = virtualFileSystemProvider.getVirtualFileSystem();
FolderEntry baseFolder = new FolderEntry(vfs.getRoot().createFolder(projectPath.toString()));
baseFolder.createFile(README_FILE_NAME, getReadmeContent());
}
use of org.eclipse.che.api.vfs.VirtualFileSystem in project che by eclipse.
the class PythonProjectGenerator method onCreateProject.
@Override
public void onCreateProject(Path projectPath, Map<String, AttributeValue> attributes, Map<String, String> options) throws ForbiddenException, ConflictException, ServerException {
VirtualFileSystem vfs = virtualFileSystemProvider.getVirtualFileSystem();
FolderEntry baseFolder = new FolderEntry(vfs.getRoot().createFolder(projectPath.toString()));
baseFolder.createFile(FILE_NAME, getClass().getClassLoader().getResourceAsStream("files/default_python_content"));
}
use of org.eclipse.che.api.vfs.VirtualFileSystem in project che by eclipse.
the class MemoryVirtualFileSystemProviderTest method returnsSameInstanceOfVirtualFileSystemOnceItWasCreated.
@Test
public void returnsSameInstanceOfVirtualFileSystemOnceItWasCreated() throws Exception {
VirtualFileSystem fileSystem = fileSystemProvider.getVirtualFileSystem(true);
assertNotNull(fileSystem);
assertSame(fileSystem, fileSystemProvider.getVirtualFileSystem(false));
}
use of org.eclipse.che.api.vfs.VirtualFileSystem in project che by eclipse.
the class MemoryVirtualFileSystemProviderTest method closesVirtualFileSystemWhenProviderIsClosed.
@Test
public void closesVirtualFileSystemWhenProviderIsClosed() throws Exception {
AtomicReference fileSystemReference = getFileSystemReference();
VirtualFileSystem fileSystem = mock(VirtualFileSystem.class);
fileSystemReference.set(fileSystem);
fileSystemProvider.close();
verify(fileSystem).close();
}
use of org.eclipse.che.api.vfs.VirtualFileSystem in project che by eclipse.
the class LocalVirtualFileSystemProviderTest method resetsVirtualFileSystemInProviderAfterClosingVirtualFileSystem.
@Test
public void resetsVirtualFileSystemInProviderAfterClosingVirtualFileSystem() throws Exception {
VirtualFileSystem fileSystem = fileSystemProvider.getVirtualFileSystem(true);
assertNotNull(fileSystem);
fileSystem.close();
assertNull(fileSystemProvider.getVirtualFileSystem(false));
}
Aggregations