public class CKANResource extends CKAN
| Modifier and Type | Field and Description |
|---|---|
static org.apache.tika.mime.MimeTypes |
ALL_MIME_TYPES |
protected String |
itemID |
protected String |
mimeType |
protected String |
originalFileExtension |
protected boolean |
persisted |
protected URL |
persistedURL |
protected com.fasterxml.jackson.databind.JsonNode |
previousRepresentation |
static String |
RESOURCE_CREATE |
static String |
RESOURCE_DELETE |
static String |
RESOURCE_NAME_REGEX |
static String |
RESOURCE_PATCH |
static String |
RESOURCE_SHOW |
static String |
RESOURCE_UPDATE |
protected String |
resourceID |
protected CatalogueStorageHubManagement |
storageHubManagement |
static String |
URI_RESOLVER_STORAGE_HUB_HOST |
static String |
URI_RESOLVER_STORAGE_HUB_PATH |
protected static String |
URL_KEY |
apiKey, AUTH_CKAN_HEADER, AUTHORIZATION_ERROR, CKAN_API_PATH, CREATE, DELETE, ERROR_KEY, ERROR_TYPE_KEY, ID_KEY, LIMIT_KEY, LIST, mapper, MESSAGE_KEY, name, NAME_KEY, NAME_REGEX, nameRegex, NOT_FOUND_ERROR, OFFSET_KEY, OWNER_ORG_KEY, PATCH, PURGE, READ, result, RESULT_KEY, SUCCESS_KEY, UPDATE, uriInfo, VALIDATION_ERROR| Constructor and Description |
|---|
CKANResource(String itemID) |
| Modifier and Type | Method and Description |
|---|---|
protected URL |
copyStorageResource(URL url)
Check if the URl is a workspace URL so that is has to copy the resource to guarantee
the resource remain persistent
|
protected String |
create(com.fasterxml.jackson.databind.JsonNode jsonNode) |
String |
create(String json) |
com.fasterxml.jackson.databind.JsonNode |
createOrUpdate(com.fasterxml.jackson.databind.JsonNode jsonNode) |
void |
delete() |
void |
delete(boolean purge) |
void |
deleteFile() |
protected void |
deleteStorageResource(URL url,
String resourceID,
String mimetype) |
static String |
extractResourceID(com.fasterxml.jackson.databind.JsonNode jsonNode) |
protected URL |
getFinalURL(String url) |
static URL |
getFinalURL(URL url) |
protected String |
getFormat() |
String |
getItemID() |
URL |
getPersistedURL() |
com.fasterxml.jackson.databind.JsonNode |
getPreviousRepresentation() |
String |
getResourceID() |
protected boolean |
isStorageFile(URL url) |
String |
list() |
String |
list(int limit,
int offeset) |
String |
patch(String json) |
protected com.fasterxml.jackson.databind.node.ObjectNode |
persistStorageFile(com.fasterxml.jackson.databind.node.ObjectNode objectNode) |
protected void |
purge() |
String |
read() |
void |
rollback() |
void |
setPreviousRepresentation(com.fasterxml.jackson.databind.JsonNode jsonNode) |
void |
setResourceID(String resourceID) |
protected String |
update(com.fasterxml.jackson.databind.JsonNode jsonNode) |
String |
update(String json) |
protected com.fasterxml.jackson.databind.node.ObjectNode |
validate(com.fasterxml.jackson.databind.JsonNode jsonNode) |
protected com.fasterxml.jackson.databind.node.ObjectNode |
validate(String json) |
checkName, checkName, createJsonNodeWithID, createJsonNodeWithNameAsID, getApiKey, getAsJsonNode, getAsString, getGXHTTPStringRequest, getJsonNodeResult, getMapper, getMapWithID, getMapWithNameAsID, getName, getResultAndValidate, sendGetRequest, sendPostRequest, sendPostRequest, setApiKey, setName, setUriInfo, validateCKANResponsepublic static final String RESOURCE_CREATE
public static final String RESOURCE_SHOW
public static final String RESOURCE_UPDATE
public static final String RESOURCE_PATCH
public static final String RESOURCE_DELETE
protected static final String URL_KEY
public static final String RESOURCE_NAME_REGEX
public static final org.apache.tika.mime.MimeTypes ALL_MIME_TYPES
public static final String URI_RESOLVER_STORAGE_HUB_HOST
public static final String URI_RESOLVER_STORAGE_HUB_PATH
protected String itemID
protected String resourceID
protected boolean persisted
protected URL persistedURL
protected String mimeType
protected String originalFileExtension
protected com.fasterxml.jackson.databind.JsonNode previousRepresentation
protected CatalogueStorageHubManagement storageHubManagement
public CKANResource(String itemID)
public String getItemID()
public URL getPersistedURL()
public static String extractResourceID(com.fasterxml.jackson.databind.JsonNode jsonNode)
public String getResourceID()
public void setResourceID(String resourceID)
public void setPreviousRepresentation(com.fasterxml.jackson.databind.JsonNode jsonNode)
public com.fasterxml.jackson.databind.JsonNode getPreviousRepresentation()
public String list()
protected String getFormat()
protected com.fasterxml.jackson.databind.node.ObjectNode persistStorageFile(com.fasterxml.jackson.databind.node.ObjectNode objectNode)
protected com.fasterxml.jackson.databind.node.ObjectNode validate(String json) throws MalformedURLException
MalformedURLExceptionprotected com.fasterxml.jackson.databind.node.ObjectNode validate(com.fasterxml.jackson.databind.JsonNode jsonNode)
protected boolean isStorageFile(URL url)
protected URL copyStorageResource(URL url)
url - the URL to checkprotected void deleteStorageResource(URL url, String resourceID, String mimetype)
protected String create(com.fasterxml.jackson.databind.JsonNode jsonNode)
protected String update(com.fasterxml.jackson.databind.JsonNode jsonNode) throws Exception
Exceptionpublic com.fasterxml.jackson.databind.JsonNode createOrUpdate(com.fasterxml.jackson.databind.JsonNode jsonNode)
public void deleteFile()
public void rollback()
Copyright © 2020. All Rights Reserved.