public static String generateInternalId(List<String> path) { return INTERNAL_ID_PREFIX + com.dremio.common.utils.PathUtils.toFSPathString(path); }
private Path getViewPath(List<String> tableSchemaPath) { List<String> fullPath = resolveTableNameToValidPath(tableSchemaPath); String parentPath = PathUtils.toFSPathString(fullPath.subList(0, fullPath.size() - 1)); return DotFileType.VIEW.getPath(parentPath, tableSchemaPath.get(tableSchemaPath.size() - 1)); }
@POST @Path("/folder/{path: .*}") @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) public Folder createFolder(FolderName name, @PathParam("path") String path) throws Exception { String fullPath = PathUtils.toFSPathString(Arrays.asList(path, name.toString())); FolderPath folderPath = FolderPath.fromURLPath(homeName, fullPath); final FolderConfig folderConfig = new FolderConfig(); folderConfig.setFullPathList(folderPath.toPathList()); folderConfig.setName(folderPath.getFolderName().getName()); try { namespaceService.addOrUpdateFolder(folderPath.toNamespaceKey(), folderConfig); } catch(NamespaceNotFoundException nfe) { throw new ClientErrorException("Parent folder doesn't exist", nfe); } return newFolder(folderPath, folderConfig, null); }
@POST @Path("/folder/{path: .*}") @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) public Folder createFolder(FolderName name, @PathParam("path") String path) throws NamespaceException { String fullPath = PathUtils.toFSPathString(Arrays.asList(path, name.toString())); FolderPath folderPath = FolderPath.fromURLPath(spaceName, fullPath); final FolderConfig folderConfig = new FolderConfig(); folderConfig.setFullPathList(folderPath.toPathList()); folderConfig.setName(folderPath.getFolderName().getName()); try { namespaceService.addOrUpdateFolder(folderPath.toNamespaceKey(), folderConfig); } catch(NamespaceNotFoundException nfe) { throw new ClientErrorException("Parent folder doesn't exist", nfe); } return newFolder(folderPath, folderConfig, null); }
pathList.add(SqlUtils.quoteIdentifier(fileName.getName())); final FilePath filePath = FilePath.fromURLPath(homeName, PathUtils.toFSPathString(pathList));
fileSelection = FileSelection.createWithFullSchema(fs, PathUtils.toFSPathString(parentSchemaPath), tableName); if (fileSelection == null) { return null; // no table found