use of org.eclipse.che.api.vfs.VirtualFileSystem in project che by eclipse.
the class PhpProjectGenerator 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_php_content"));
}
use of org.eclipse.che.api.vfs.VirtualFileSystem in project che by eclipse.
the class NodeJsProjectGenerator 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_node_content"));
}
use of org.eclipse.che.api.vfs.VirtualFileSystem in project che by eclipse.
the class IndexedFileUpdateConsumer method accept.
@Override
public void accept(Path path) {
try {
VirtualFileSystem virtualFileSystem = vfsProvider.getVirtualFileSystem();
SearcherProvider searcherProvider = virtualFileSystem.getSearcherProvider();
Searcher searcher = searcherProvider.getSearcher(virtualFileSystem);
Path innerPath = root.toPath().relativize(path);
org.eclipse.che.api.vfs.Path vfsPath = org.eclipse.che.api.vfs.Path.of(innerPath.toString());
VirtualFile child = virtualFileSystem.getRoot().getChild(vfsPath);
if (child != null) {
searcher.update(child);
}
} catch (ServerException e) {
LOG.error("Issue happened during updating modified file in index", e);
}
}
use of org.eclipse.che.api.vfs.VirtualFileSystem in project che by eclipse.
the class CreateNetCoreProjectHandler 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(PROJECT_FILE_NAME, getProjectContent());
}
use of org.eclipse.che.api.vfs.VirtualFileSystem in project che by eclipse.
the class ComposerProjectGenerator method onCreateProject.
@Override
public void onCreateProject(Path projectPath, Map<String, AttributeValue> attributes, Map<String, String> options) throws ForbiddenException, ConflictException, ServerException {
AttributeValue packageName = attributes.get(Constants.PACKAGE);
if (packageName == null) {
throw new ServerException("Missed some required options (package)");
}
VirtualFileSystem vfs = virtualFileSystemProvider.getVirtualFileSystem();
String projectAbsolutePath = new File(vfs.getRoot().toIoFile(), projectPath.toString()).toString();
String[] commandLine = { "composer", "create-project", packageName.getString(), projectAbsolutePath, "--no-install" };
try {
ComposerCommandExecutor.execute(commandLine, null);
} catch (TimeoutException | IOException | InterruptedException e) {
throw new ServerException(e);
}
}
Aggregations