public String toUrlEncodedString() { return PathUtils.encodeURIComponent(schemaPath); }
public final String build() { final StringBuilder stringBuilder = new StringBuilder(); for (int i = 0; i < parts.size(); ++i) { stringBuilder.append("/" + PathUtils.encodeURIComponent(parts.get(i))); } return stringBuilder.toString(); } }
public String toUrl() { try { String filterStr = new ObjectMapper().writeValueAsString(filters); String escapedFilter = PathUtils.encodeURIComponent(filterStr); if (sort != null) { return format("/jobs?filters=%s&sort=%s&order=%s", escapedFilter, PathUtils.encodeURIComponent(sort), order); } else { return format("/jobs?filters=%s", escapedFilter); } } catch (JsonProcessingException jpe) { throw new DACRuntimeException(jpe); } } }
@Test public void testSourceBrowsing() throws Exception { Source source = createSource(); // browse to the json directory String id = getFolderIdByName(source.getChildren(), "\"json\""); assertNotNull(id, "Failed to find json directory"); // deleting a folder on a source should fail expectStatus(Response.Status.BAD_REQUEST, getBuilder(getPublicAPI(3).path(CATALOG_PATH).path(com.dremio.common.utils.PathUtils.encodeURIComponent(id))).buildDelete()); newNamespaceService().deleteSource(new NamespaceKey(source.getName()), source.getTag()); }
Folder folder = expectSuccess(getBuilder(getPublicAPI(3).path(CATALOG_PATH).path(com.dremio.common.utils.PathUtils.encodeURIComponent(id))).buildGet(), new GenericType<Folder>() {}); assertEquals(folder.getChildren().size(), 19); File file = expectSuccess(getBuilder(getPublicAPI(3).path(CATALOG_PATH).path(com.dremio.common.utils.PathUtils.encodeURIComponent(fileId))).buildGet(), new GenericType<File>() {}); dataset = expectSuccess(getBuilder(getPublicAPI(3).path(CATALOG_PATH).path(com.dremio.common.utils.PathUtils.encodeURIComponent(fileId))).buildPost(Entity.json(dataset)), new GenericType<Dataset>() {}); folder = expectSuccess(getBuilder(getPublicAPI(3).path(CATALOG_PATH).path(com.dremio.common.utils.PathUtils.encodeURIComponent(id))).buildGet(), new GenericType<Folder>() {}); assertEquals(folder.getChildren().size(), 19); folder = expectSuccess(getBuilder(getPublicAPI(3).path(CATALOG_PATH).path(com.dremio.common.utils.PathUtils.encodeURIComponent(id))).buildGet(), new GenericType<Folder>() {}); assertEquals(folder.getChildren().size(), 19); assertNotNull(folderId, "Failed to find datasets directory"); Folder dsFolder = expectSuccess(getBuilder(getPublicAPI(3).path(CATALOG_PATH).path(com.dremio.common.utils.PathUtils.encodeURIComponent(folderId))).buildGet(), new GenericType<Folder>() {}); folder = expectSuccess(getBuilder(getPublicAPI(3).path(CATALOG_PATH).path(com.dremio.common.utils.PathUtils.encodeURIComponent(folderDatasetId))).buildGet(), new GenericType<Folder>() {}); dataset = createPDS(folder.getPath(), textFileConfig); dataset = expectSuccess(getBuilder(getPublicAPI(3).path(CATALOG_PATH).path(com.dremio.common.utils.PathUtils.encodeURIComponent(folderDatasetId))).buildPost(Entity.json(dataset)), new GenericType<Dataset>() {});
Folder folder = expectSuccess(getBuilder(getPublicAPI(3).path(CATALOG_PATH).path(com.dremio.common.utils.PathUtils.encodeURIComponent(id))).buildGet(), new GenericType<Folder>() { }); assertEquals(folder.getChildren().size(), 1); File file = expectSuccess(getBuilder(getPublicAPI(3).path(CATALOG_PATH).path(com.dremio.common.utils.PathUtils.encodeURIComponent(fileId))).buildGet(), new GenericType<File>() { }); getBuilder(getPublicAPI(3) .path(CATALOG_PATH) .path(com.dremio.common.utils.PathUtils.encodeURIComponent(fileId))) .buildPost(Entity.json(dataset)), new GenericType<Dataset>() { }); getBuilder(getPublicAPI(3) .path(CATALOG_PATH) .path(com.dremio.common.utils.PathUtils.encodeURIComponent(id))) .buildGet(), new GenericType<Folder>() { }); getBuilder(getPublicAPI(3) .path(CATALOG_PATH) .path(com.dremio.common.utils.PathUtils.encodeURIComponent(id)) .path("metadata/refresh")) .buildPost(Entity.json(response))); getBuilder(getPublicAPI(3) .path(CATALOG_PATH) .path(com.dremio.common.utils.PathUtils.encodeURIComponent("asdfasdf")) .path("metadata/refresh"))
getBuilder(getPublicAPI(3) .path(CATALOG_PATH) .path(PathUtils.encodeURIComponent(id)) ).buildGet(), new GenericType<Folder>() {} getBuilder(getPublicAPI(3) .path(CATALOG_PATH) .path(PathUtils.encodeURIComponent(fileId)) ).buildGet(), new GenericType<File>() {} getBuilder(getPublicAPI(3) .path(CATALOG_PATH) .path(PathUtils.encodeURIComponent(fileId))) .buildPost(Entity.json(dataset) ), getBuilder(getPublicAPI(3) .path(CATALOG_PATH) .path(PathUtils.encodeURIComponent(id)) ).buildGet(), new GenericType<Folder>() {} getBuilder(getPublicAPI(3) .path(CATALOG_PATH) .path(PathUtils.encodeURIComponent(id)) ).buildGet(), new GenericType<Folder>() {}
getBuilder(getPublicAPI(3) .path(CATALOG_PATH) .path(PathUtils.encodeURIComponent(id)) ).buildGet(), new GenericType<Folder>() {} getBuilder(getPublicAPI(3) .path(CATALOG_PATH) .path(PathUtils.encodeURIComponent(folderId)) ).buildGet(), new GenericType<Folder>() {} getBuilder(getPublicAPI(3) .path(CATALOG_PATH) .path(PathUtils.encodeURIComponent(folderDatasetId)) ).buildGet(), new GenericType<Folder>() {} getBuilder(getPublicAPI(3) .path(CATALOG_PATH) .path(PathUtils.encodeURIComponent(folderDatasetId)) ).buildPost(Entity.json(dataset)), new GenericType<Dataset>() {}