id int32 0 165k | repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1
value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 |
|---|---|---|---|---|---|---|---|---|---|---|---|
102,800 | fcrepo4/fcrepo4 | fcrepo-kernel-modeshape/src/main/java/org/fcrepo/kernel/modeshape/rdf/JcrRdfTools.java | JcrRdfTools.removeMixin | public void removeMixin(final FedoraResource resource,
final Resource mixinResource,
final Map<String, String> nsPrefixMap) throws RepositoryException {
final Node node = getJcrNode(resource);
final String mixinName = getPropertyNameFromPredicate(... | java | public void removeMixin(final FedoraResource resource,
final Resource mixinResource,
final Map<String, String> nsPrefixMap) throws RepositoryException {
final Node node = getJcrNode(resource);
final String mixinName = getPropertyNameFromPredicate(... | [
"public",
"void",
"removeMixin",
"(",
"final",
"FedoraResource",
"resource",
",",
"final",
"Resource",
"mixinResource",
",",
"final",
"Map",
"<",
"String",
",",
"String",
">",
"nsPrefixMap",
")",
"throws",
"RepositoryException",
"{",
"final",
"Node",
"node",
"="... | Remove a mixin from a node
@param resource the resource
@param mixinResource the mixin resource
@param nsPrefixMap the prefix map
@throws RepositoryException if repository exception occurred | [
"Remove",
"a",
"mixin",
"from",
"a",
"node"
] | 7489ad5bc8fb44e2442c93eceb7d97ac54553ab6 | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-kernel-modeshape/src/main/java/org/fcrepo/kernel/modeshape/rdf/JcrRdfTools.java#L348-L358 |
102,801 | fcrepo4/fcrepo4 | fcrepo-kernel-modeshape/src/main/java/org/fcrepo/kernel/modeshape/rdf/JcrRdfTools.java | JcrRdfTools.removeProperty | public void removeProperty(final FedoraResource resource,
final org.apache.jena.rdf.model.Property predicate,
final RDFNode objectNode,
final Map<String, String> nsPrefixMap) throws RepositoryException {
final Node nod... | java | public void removeProperty(final FedoraResource resource,
final org.apache.jena.rdf.model.Property predicate,
final RDFNode objectNode,
final Map<String, String> nsPrefixMap) throws RepositoryException {
final Node nod... | [
"public",
"void",
"removeProperty",
"(",
"final",
"FedoraResource",
"resource",
",",
"final",
"org",
".",
"apache",
".",
"jena",
".",
"rdf",
".",
"model",
".",
"Property",
"predicate",
",",
"final",
"RDFNode",
"objectNode",
",",
"final",
"Map",
"<",
"String"... | Remove a property from a node
@param resource the fedora resource
@param predicate the predicate
@param objectNode the object node
@param nsPrefixMap the prefix map
@throws RepositoryException if repository exception occurred | [
"Remove",
"a",
"property",
"from",
"a",
"node"
] | 7489ad5bc8fb44e2442c93eceb7d97ac54553ab6 | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-kernel-modeshape/src/main/java/org/fcrepo/kernel/modeshape/rdf/JcrRdfTools.java#L368-L395 |
102,802 | fcrepo4/fcrepo4 | fcrepo-kernel-modeshape/src/main/java/org/fcrepo/kernel/modeshape/rdf/JcrRdfTools.java | JcrRdfTools.skolemize | public Statement skolemize(final IdentifierConverter<Resource, FedoraResource> idTranslator, final Statement t,
final String topic) throws RepositoryException {
Statement skolemized = t;
if (t.getSubject().isAnon()) {
skolemized = m.createStatement(getSkolemizedResource(idTrans... | java | public Statement skolemize(final IdentifierConverter<Resource, FedoraResource> idTranslator, final Statement t,
final String topic) throws RepositoryException {
Statement skolemized = t;
if (t.getSubject().isAnon()) {
skolemized = m.createStatement(getSkolemizedResource(idTrans... | [
"public",
"Statement",
"skolemize",
"(",
"final",
"IdentifierConverter",
"<",
"Resource",
",",
"FedoraResource",
">",
"idTranslator",
",",
"final",
"Statement",
"t",
",",
"final",
"String",
"topic",
")",
"throws",
"RepositoryException",
"{",
"Statement",
"skolemized... | Convert an external statement into a persistable statement by skolemizing
blank nodes, creating hash-uri subjects, etc
@param idTranslator the property of idTranslator
@param t the statement
@param topic the topic
@return the persistable statement
@throws RepositoryException if repository exception occurred | [
"Convert",
"an",
"external",
"statement",
"into",
"a",
"persistable",
"statement",
"by",
"skolemizing",
"blank",
"nodes",
"creating",
"hash",
"-",
"uri",
"subjects",
"etc"
] | 7489ad5bc8fb44e2442c93eceb7d97ac54553ab6 | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-kernel-modeshape/src/main/java/org/fcrepo/kernel/modeshape/rdf/JcrRdfTools.java#L407-L430 |
102,803 | fcrepo4/fcrepo4 | fcrepo-event-serialization/src/main/java/org/fcrepo/event/serialization/JsonLDEventMessage.java | JsonLDEventMessage.from | public static JsonLDEventMessage from(final FedoraEvent evt) {
final String baseUrl = evt.getInfo().get(BASE_URL);
// build objectId
final String objectId = convertToExternalPath(baseUrl + evt.getPath());
// build event types list
final List<String> types = evt.getTypes()
... | java | public static JsonLDEventMessage from(final FedoraEvent evt) {
final String baseUrl = evt.getInfo().get(BASE_URL);
// build objectId
final String objectId = convertToExternalPath(baseUrl + evt.getPath());
// build event types list
final List<String> types = evt.getTypes()
... | [
"public",
"static",
"JsonLDEventMessage",
"from",
"(",
"final",
"FedoraEvent",
"evt",
")",
"{",
"final",
"String",
"baseUrl",
"=",
"evt",
".",
"getInfo",
"(",
")",
".",
"get",
"(",
"BASE_URL",
")",
";",
"// build objectId",
"final",
"String",
"objectId",
"="... | Populate a JsonLDEventMessage from a FedoraEvent
@param evt The Fedora event
@return a JsonLDEventMessage | [
"Populate",
"a",
"JsonLDEventMessage",
"from",
"a",
"FedoraEvent"
] | 7489ad5bc8fb44e2442c93eceb7d97ac54553ab6 | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-event-serialization/src/main/java/org/fcrepo/event/serialization/JsonLDEventMessage.java#L165-L205 |
102,804 | fcrepo4/fcrepo4 | fcrepo-http-commons/src/main/java/org/fcrepo/http/commons/domain/Range.java | Range.convert | public static Range convert(final String source) {
final Matcher matcher = rangePattern.matcher(source);
if (!matcher.matches()) {
return new Range();
}
final String from = matcher.group(1);
final String to = matcher.group(2);
final long start;
if... | java | public static Range convert(final String source) {
final Matcher matcher = rangePattern.matcher(source);
if (!matcher.matches()) {
return new Range();
}
final String from = matcher.group(1);
final String to = matcher.group(2);
final long start;
if... | [
"public",
"static",
"Range",
"convert",
"(",
"final",
"String",
"source",
")",
"{",
"final",
"Matcher",
"matcher",
"=",
"rangePattern",
".",
"matcher",
"(",
"source",
")",
";",
"if",
"(",
"!",
"matcher",
".",
"matches",
"(",
")",
")",
"{",
"return",
"n... | Convert an HTTP Range header to a Range object
@param source the source
@return range object | [
"Convert",
"an",
"HTTP",
"Range",
"header",
"to",
"a",
"Range",
"object"
] | 7489ad5bc8fb44e2442c93eceb7d97ac54553ab6 | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-http-commons/src/main/java/org/fcrepo/http/commons/domain/Range.java#L105-L132 |
102,805 | fcrepo4/fcrepo4 | fcrepo-kernel-modeshape/src/main/java/org/fcrepo/kernel/modeshape/FedoraRepositoryImpl.java | FedoraRepositoryImpl.getJcrRepository | public static Repository getJcrRepository(final FedoraRepository repository) {
if (repository instanceof FedoraRepositoryImpl) {
return ((FedoraRepositoryImpl)repository).getJcrRepository();
}
throw new ClassCastException("FedoraRepository is not a " + FedoraRepositoryImpl.class.getC... | java | public static Repository getJcrRepository(final FedoraRepository repository) {
if (repository instanceof FedoraRepositoryImpl) {
return ((FedoraRepositoryImpl)repository).getJcrRepository();
}
throw new ClassCastException("FedoraRepository is not a " + FedoraRepositoryImpl.class.getC... | [
"public",
"static",
"Repository",
"getJcrRepository",
"(",
"final",
"FedoraRepository",
"repository",
")",
"{",
"if",
"(",
"repository",
"instanceof",
"FedoraRepositoryImpl",
")",
"{",
"return",
"(",
"(",
"FedoraRepositoryImpl",
")",
"repository",
")",
".",
"getJcrR... | Retrieve the internal JCR Repository from a FedoraRepository object
@param repository the FedoraRepository
@return the JCR Repository | [
"Retrieve",
"the",
"internal",
"JCR",
"Repository",
"from",
"a",
"FedoraRepository",
"object"
] | 7489ad5bc8fb44e2442c93eceb7d97ac54553ab6 | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-kernel-modeshape/src/main/java/org/fcrepo/kernel/modeshape/FedoraRepositoryImpl.java#L82-L87 |
102,806 | fcrepo4/fcrepo4 | fcrepo-http-api/src/main/java/org/fcrepo/http/api/ExternalContentHandler.java | ExternalContentHandler.fetchExternalContent | public InputStream fetchExternalContent() {
final URI uri = link.getUri();
final String scheme = uri.getScheme();
LOGGER.debug("scheme is {}", scheme);
if (scheme != null) {
try {
if (scheme.equals("file")) {
return new FileInputStream(uri... | java | public InputStream fetchExternalContent() {
final URI uri = link.getUri();
final String scheme = uri.getScheme();
LOGGER.debug("scheme is {}", scheme);
if (scheme != null) {
try {
if (scheme.equals("file")) {
return new FileInputStream(uri... | [
"public",
"InputStream",
"fetchExternalContent",
"(",
")",
"{",
"final",
"URI",
"uri",
"=",
"link",
".",
"getUri",
"(",
")",
";",
"final",
"String",
"scheme",
"=",
"uri",
".",
"getScheme",
"(",
")",
";",
"LOGGER",
".",
"debug",
"(",
"\"scheme is {}\"",
"... | Fetch the external content
@return InputStream containing the external content | [
"Fetch",
"the",
"external",
"content"
] | 7489ad5bc8fb44e2442c93eceb7d97ac54553ab6 | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-http-api/src/main/java/org/fcrepo/http/api/ExternalContentHandler.java#L140-L157 |
102,807 | fcrepo4/fcrepo4 | fcrepo-http-api/src/main/java/org/fcrepo/http/api/ExternalContentHandler.java | ExternalContentHandler.parseLinkHeader | private Link parseLinkHeader(final String link) throws ExternalMessageBodyException {
final Link realLink = Link.valueOf(link);
try {
final String handling = realLink.getParams().get(HANDLING);
if (handling == null || !handling.matches("(?i)" + PROXY + "|" + COPY + "|" + REDIREC... | java | private Link parseLinkHeader(final String link) throws ExternalMessageBodyException {
final Link realLink = Link.valueOf(link);
try {
final String handling = realLink.getParams().get(HANDLING);
if (handling == null || !handling.matches("(?i)" + PROXY + "|" + COPY + "|" + REDIREC... | [
"private",
"Link",
"parseLinkHeader",
"(",
"final",
"String",
"link",
")",
"throws",
"ExternalMessageBodyException",
"{",
"final",
"Link",
"realLink",
"=",
"Link",
".",
"valueOf",
"(",
"link",
")",
";",
"try",
"{",
"final",
"String",
"handling",
"=",
"realLink... | Validate that an external content link header is appropriately formatted
@param link to be validated
@return Link object if the header is formatted correctly, else null
@throws ExternalMessageBodyException on error | [
"Validate",
"that",
"an",
"external",
"content",
"link",
"header",
"is",
"appropriately",
"formatted"
] | 7489ad5bc8fb44e2442c93eceb7d97ac54553ab6 | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-http-api/src/main/java/org/fcrepo/http/api/ExternalContentHandler.java#L165-L179 |
102,808 | fcrepo4/fcrepo4 | fcrepo-http-api/src/main/java/org/fcrepo/http/api/ExternalContentHandler.java | ExternalContentHandler.findContentType | private MediaType findContentType(final String url) {
if (url == null) {
return null;
}
if (url.startsWith("file")) {
return APPLICATION_OCTET_STREAM_TYPE;
} else if (url.startsWith("http")) {
try (CloseableHttpClient httpClient = HttpClients.createDe... | java | private MediaType findContentType(final String url) {
if (url == null) {
return null;
}
if (url.startsWith("file")) {
return APPLICATION_OCTET_STREAM_TYPE;
} else if (url.startsWith("http")) {
try (CloseableHttpClient httpClient = HttpClients.createDe... | [
"private",
"MediaType",
"findContentType",
"(",
"final",
"String",
"url",
")",
"{",
"if",
"(",
"url",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"if",
"(",
"url",
".",
"startsWith",
"(",
"\"file\"",
")",
")",
"{",
"return",
"APPLICATION_OCTET_ST... | Find the content type for a remote resource
@param url of remote resource
@return the content type reported by remote system or "application/octet-stream" if not supplied | [
"Find",
"the",
"content",
"type",
"for",
"a",
"remote",
"resource"
] | 7489ad5bc8fb44e2442c93eceb7d97ac54553ab6 | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-http-api/src/main/java/org/fcrepo/http/api/ExternalContentHandler.java#L186-L212 |
102,809 | fcrepo4/fcrepo4 | fcrepo-kernel-modeshape/src/main/java/org/fcrepo/kernel/modeshape/utils/NodePropertiesTools.java | NodePropertiesTools.addReferencePlaceholders | public void addReferencePlaceholders(final IdentifierConverter<Resource,FedoraResource> idTranslator,
final Node node,
final String propertyName,
final Resource resource) throws RepositoryExcept... | java | public void addReferencePlaceholders(final IdentifierConverter<Resource,FedoraResource> idTranslator,
final Node node,
final String propertyName,
final Resource resource) throws RepositoryExcept... | [
"public",
"void",
"addReferencePlaceholders",
"(",
"final",
"IdentifierConverter",
"<",
"Resource",
",",
"FedoraResource",
">",
"idTranslator",
",",
"final",
"Node",
"node",
",",
"final",
"String",
"propertyName",
",",
"final",
"Resource",
"resource",
")",
"throws",... | Add a reference placeholder from one node to another in-domain resource
@param idTranslator the id translator
@param node the node
@param propertyName the property name
@param resource the resource
@throws RepositoryException if repository exception occurred | [
"Add",
"a",
"reference",
"placeholder",
"from",
"one",
"node",
"to",
"another",
"in",
"-",
"domain",
"resource"
] | 7489ad5bc8fb44e2442c93eceb7d97ac54553ab6 | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-kernel-modeshape/src/main/java/org/fcrepo/kernel/modeshape/utils/NodePropertiesTools.java#L141-L172 |
102,810 | fcrepo4/fcrepo4 | fcrepo-kernel-modeshape/src/main/java/org/fcrepo/kernel/modeshape/utils/NodePropertiesTools.java | NodePropertiesTools.removeReferencePlaceholders | public void removeReferencePlaceholders(final IdentifierConverter<Resource,FedoraResource> idTranslator,
final Node node,
final String propertyName,
final Resource resource) throws Repo... | java | public void removeReferencePlaceholders(final IdentifierConverter<Resource,FedoraResource> idTranslator,
final Node node,
final String propertyName,
final Resource resource) throws Repo... | [
"public",
"void",
"removeReferencePlaceholders",
"(",
"final",
"IdentifierConverter",
"<",
"Resource",
",",
"FedoraResource",
">",
"idTranslator",
",",
"final",
"Node",
"node",
",",
"final",
"String",
"propertyName",
",",
"final",
"Resource",
"resource",
")",
"throw... | Remove a reference placeholder that links one node to another in-domain resource
@param idTranslator the id translator
@param node the node
@param propertyName the property name
@param resource the resource
@throws RepositoryException if repository exception occurred | [
"Remove",
"a",
"reference",
"placeholder",
"that",
"links",
"one",
"node",
"to",
"another",
"in",
"-",
"domain",
"resource"
] | 7489ad5bc8fb44e2442c93eceb7d97ac54553ab6 | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-kernel-modeshape/src/main/java/org/fcrepo/kernel/modeshape/utils/NodePropertiesTools.java#L182-L192 |
102,811 | fcrepo4/fcrepo4 | fcrepo-http-api/src/main/java/org/fcrepo/http/api/ExternalContentHandlerFactory.java | ExternalContentHandlerFactory.createFromLinks | public ExternalContentHandler createFromLinks(final List<String> links) throws ExternalMessageBodyException {
if (links == null) {
return null;
}
final List<String> externalContentLinks = links.stream()
.filter(x -> x.contains(EXTERNAL_CONTENT.toString()))
... | java | public ExternalContentHandler createFromLinks(final List<String> links) throws ExternalMessageBodyException {
if (links == null) {
return null;
}
final List<String> externalContentLinks = links.stream()
.filter(x -> x.contains(EXTERNAL_CONTENT.toString()))
... | [
"public",
"ExternalContentHandler",
"createFromLinks",
"(",
"final",
"List",
"<",
"String",
">",
"links",
")",
"throws",
"ExternalMessageBodyException",
"{",
"if",
"(",
"links",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"final",
"List",
"<",
"String"... | Looks for ExternalContent link header and if it finds one it will return a new ExternalContentHandler object
based on the found Link header. If multiple external content headers were found or the URI provided in the
header is not a valid external content path, then an ExternalMessageBodyException will be thrown.
@para... | [
"Looks",
"for",
"ExternalContent",
"link",
"header",
"and",
"if",
"it",
"finds",
"one",
"it",
"will",
"return",
"a",
"new",
"ExternalContentHandler",
"object",
"based",
"on",
"the",
"found",
"Link",
"header",
".",
"If",
"multiple",
"external",
"content",
"head... | 7489ad5bc8fb44e2442c93eceb7d97ac54553ab6 | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-http-api/src/main/java/org/fcrepo/http/api/ExternalContentHandlerFactory.java#L50-L77 |
102,812 | fcrepo4/fcrepo4 | fcrepo-http-commons/src/main/java/org/fcrepo/http/commons/api/rdf/HttpResourceConverter.java | HttpResourceConverter.doBackwardPathOnly | private String doBackwardPathOnly(final FedoraResource resource) {
final String path = reverse.convert(resource.getPath());
if (path == null) {
throw new RepositoryRuntimeException("Unable to process reverse chain for resource " + resource);
}
return convertToExternalPath(p... | java | private String doBackwardPathOnly(final FedoraResource resource) {
final String path = reverse.convert(resource.getPath());
if (path == null) {
throw new RepositoryRuntimeException("Unable to process reverse chain for resource " + resource);
}
return convertToExternalPath(p... | [
"private",
"String",
"doBackwardPathOnly",
"(",
"final",
"FedoraResource",
"resource",
")",
"{",
"final",
"String",
"path",
"=",
"reverse",
".",
"convert",
"(",
"resource",
".",
"getPath",
"(",
")",
")",
";",
"if",
"(",
"path",
"==",
"null",
")",
"{",
"t... | Get only the resource path to this resource, before embedding it in a full URI
@param resource with desired path
@return path | [
"Get",
"only",
"the",
"resource",
"path",
"to",
"this",
"resource",
"before",
"embedding",
"it",
"in",
"a",
"full",
"URI"
] | 7489ad5bc8fb44e2442c93eceb7d97ac54553ab6 | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-http-commons/src/main/java/org/fcrepo/http/commons/api/rdf/HttpResourceConverter.java#L285-L293 |
102,813 | fcrepo4/fcrepo4 | fcrepo-http-commons/src/main/java/org/fcrepo/http/commons/api/rdf/HttpResourceConverter.java | HttpResourceConverter.convertToExternalPath | public static String convertToExternalPath(final String path) {
String newPath = replaceOnce(path, "/" + CONTAINER_WEBAC_ACL, "/" + FCR_ACL);
newPath = replaceOnce(newPath, "/" + LDPCV_TIME_MAP, "/" + FCR_VERSIONS);
newPath = replaceOnce(newPath, "/" + FEDORA_DESCRIPTION, "/" + FCR_METADATA);... | java | public static String convertToExternalPath(final String path) {
String newPath = replaceOnce(path, "/" + CONTAINER_WEBAC_ACL, "/" + FCR_ACL);
newPath = replaceOnce(newPath, "/" + LDPCV_TIME_MAP, "/" + FCR_VERSIONS);
newPath = replaceOnce(newPath, "/" + FEDORA_DESCRIPTION, "/" + FCR_METADATA);... | [
"public",
"static",
"String",
"convertToExternalPath",
"(",
"final",
"String",
"path",
")",
"{",
"String",
"newPath",
"=",
"replaceOnce",
"(",
"path",
",",
"\"/\"",
"+",
"CONTAINER_WEBAC_ACL",
",",
"\"/\"",
"+",
"FCR_ACL",
")",
";",
"newPath",
"=",
"replaceOnc... | Converts internal path segments to their external formats.
@param path the internal path
@return the external path | [
"Converts",
"internal",
"path",
"segments",
"to",
"their",
"external",
"formats",
"."
] | 7489ad5bc8fb44e2442c93eceb7d97ac54553ab6 | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-http-commons/src/main/java/org/fcrepo/http/commons/api/rdf/HttpResourceConverter.java#L300-L308 |
102,814 | fcrepo4/fcrepo4 | fcrepo-kernel-modeshape/src/main/java/org/fcrepo/kernel/modeshape/observer/SimpleObserver.java | SimpleObserver.buildListener | @PostConstruct
public void buildListener() throws RepositoryException {
LOGGER.debug("Constructing an observer for JCR events...");
session = getJcrSession(repository.login());
session.getWorkspace().getObservationManager()
.addEventListener(this, EVENT_TYPES, "/", true, null... | java | @PostConstruct
public void buildListener() throws RepositoryException {
LOGGER.debug("Constructing an observer for JCR events...");
session = getJcrSession(repository.login());
session.getWorkspace().getObservationManager()
.addEventListener(this, EVENT_TYPES, "/", true, null... | [
"@",
"PostConstruct",
"public",
"void",
"buildListener",
"(",
")",
"throws",
"RepositoryException",
"{",
"LOGGER",
".",
"debug",
"(",
"\"Constructing an observer for JCR events...\"",
")",
";",
"session",
"=",
"getJcrSession",
"(",
"repository",
".",
"login",
"(",
"... | Register this observer with the JCR event listeners
@throws RepositoryException if repository exception occurred | [
"Register",
"this",
"observer",
"with",
"the",
"JCR",
"event",
"listeners"
] | 7489ad5bc8fb44e2442c93eceb7d97ac54553ab6 | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-kernel-modeshape/src/main/java/org/fcrepo/kernel/modeshape/observer/SimpleObserver.java#L183-L190 |
102,815 | fcrepo4/fcrepo4 | fcrepo-kernel-modeshape/src/main/java/org/fcrepo/kernel/modeshape/observer/SimpleObserver.java | SimpleObserver.stopListening | @PreDestroy
public void stopListening() throws RepositoryException {
try {
LOGGER.debug("Destroying an observer for JCR events...");
session.getWorkspace().getObservationManager().removeEventListener(this);
} finally {
session.logout();
}
} | java | @PreDestroy
public void stopListening() throws RepositoryException {
try {
LOGGER.debug("Destroying an observer for JCR events...");
session.getWorkspace().getObservationManager().removeEventListener(this);
} finally {
session.logout();
}
} | [
"@",
"PreDestroy",
"public",
"void",
"stopListening",
"(",
")",
"throws",
"RepositoryException",
"{",
"try",
"{",
"LOGGER",
".",
"debug",
"(",
"\"Destroying an observer for JCR events...\"",
")",
";",
"session",
".",
"getWorkspace",
"(",
")",
".",
"getObservationMan... | logout of the session
@throws RepositoryException if repository exception occurred | [
"logout",
"of",
"the",
"session"
] | 7489ad5bc8fb44e2442c93eceb7d97ac54553ab6 | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-kernel-modeshape/src/main/java/org/fcrepo/kernel/modeshape/observer/SimpleObserver.java#L197-L205 |
102,816 | fcrepo4/fcrepo4 | fcrepo-kernel-modeshape/src/main/java/org/fcrepo/kernel/modeshape/observer/SimpleObserver.java | SimpleObserver.onEvent | @Override
public void onEvent(final javax.jcr.observation.EventIterator events) {
Session lookupSession = null;
try {
lookupSession = getJcrSession(repository.login());
@SuppressWarnings("unchecked")
final Iterator<Event> filteredEvents = filter(events, eventFilt... | java | @Override
public void onEvent(final javax.jcr.observation.EventIterator events) {
Session lookupSession = null;
try {
lookupSession = getJcrSession(repository.login());
@SuppressWarnings("unchecked")
final Iterator<Event> filteredEvents = filter(events, eventFilt... | [
"@",
"Override",
"public",
"void",
"onEvent",
"(",
"final",
"javax",
".",
"jcr",
".",
"observation",
".",
"EventIterator",
"events",
")",
"{",
"Session",
"lookupSession",
"=",
"null",
";",
"try",
"{",
"lookupSession",
"=",
"getJcrSession",
"(",
"repository",
... | Filter JCR events and transform them into our own FedoraEvents.
@param events the JCR events | [
"Filter",
"JCR",
"events",
"and",
"transform",
"them",
"into",
"our",
"own",
"FedoraEvents",
"."
] | 7489ad5bc8fb44e2442c93eceb7d97ac54553ab6 | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-kernel-modeshape/src/main/java/org/fcrepo/kernel/modeshape/observer/SimpleObserver.java#L212-L229 |
102,817 | fcrepo4/fcrepo4 | fcrepo-kernel-modeshape/src/main/java/org/fcrepo/kernel/modeshape/services/BatchServiceImpl.java | BatchServiceImpl.removeExpired | @Override
@Scheduled(fixedRate = REAP_INTERVAL)
public void removeExpired() {
final Set<String> reapable = sessions.entrySet().stream()
.filter(e -> e.getValue().getExpires().isPresent())
.filter(e -> e.getValue().getExpires().get().isBefore(now()))
.map(M... | java | @Override
@Scheduled(fixedRate = REAP_INTERVAL)
public void removeExpired() {
final Set<String> reapable = sessions.entrySet().stream()
.filter(e -> e.getValue().getExpires().isPresent())
.filter(e -> e.getValue().getExpires().get().isBefore(now()))
.map(M... | [
"@",
"Override",
"@",
"Scheduled",
"(",
"fixedRate",
"=",
"REAP_INTERVAL",
")",
"public",
"void",
"removeExpired",
"(",
")",
"{",
"final",
"Set",
"<",
"String",
">",
"reapable",
"=",
"sessions",
".",
"entrySet",
"(",
")",
".",
"stream",
"(",
")",
".",
... | Every REAP_INTERVAL milliseconds, check for expired sessions. If the
tx is expired, roll it back and remove it from the registry. | [
"Every",
"REAP_INTERVAL",
"milliseconds",
"check",
"for",
"expired",
"sessions",
".",
"If",
"the",
"tx",
"is",
"expired",
"roll",
"it",
"back",
"and",
"remove",
"it",
"from",
"the",
"registry",
"."
] | 7489ad5bc8fb44e2442c93eceb7d97ac54553ab6 | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-kernel-modeshape/src/main/java/org/fcrepo/kernel/modeshape/services/BatchServiceImpl.java#L70-L88 |
102,818 | fcrepo4/fcrepo4 | fcrepo-http-commons/src/main/java/org/fcrepo/http/commons/api/HttpHeaderInjector.java | HttpHeaderInjector.addHttpHeaderToResponseStream | public void addHttpHeaderToResponseStream(final HttpServletResponse servletResponse,
final UriInfo uriInfo,
final FedoraResource resource) {
getUriAwareHttpHeaderFactories().forEach((bean, factory) -> {
LOGG... | java | public void addHttpHeaderToResponseStream(final HttpServletResponse servletResponse,
final UriInfo uriInfo,
final FedoraResource resource) {
getUriAwareHttpHeaderFactories().forEach((bean, factory) -> {
LOGG... | [
"public",
"void",
"addHttpHeaderToResponseStream",
"(",
"final",
"HttpServletResponse",
"servletResponse",
",",
"final",
"UriInfo",
"uriInfo",
",",
"final",
"FedoraResource",
"resource",
")",
"{",
"getUriAwareHttpHeaderFactories",
"(",
")",
".",
"forEach",
"(",
"(",
"... | Add additional Http Headers
@param servletResponse the response
@param uriInfo the URI context
@param resource the resource | [
"Add",
"additional",
"Http",
"Headers"
] | 7489ad5bc8fb44e2442c93eceb7d97ac54553ab6 | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-http-commons/src/main/java/org/fcrepo/http/commons/api/HttpHeaderInjector.java#L66-L78 |
102,819 | fcrepo4/fcrepo4 | fcrepo-http-commons/src/main/java/org/fcrepo/http/commons/AbstractResource.java | AbstractResource.toPath | public static String toPath(final IdentifierConverter<Resource, FedoraResource> idTranslator,
final String originalPath) {
final Resource resource = idTranslator.toDomain(originalPath);
final String path = idTranslator.asString(resource);
return path.isEmpty() ... | java | public static String toPath(final IdentifierConverter<Resource, FedoraResource> idTranslator,
final String originalPath) {
final Resource resource = idTranslator.toDomain(originalPath);
final String path = idTranslator.asString(resource);
return path.isEmpty() ... | [
"public",
"static",
"String",
"toPath",
"(",
"final",
"IdentifierConverter",
"<",
"Resource",
",",
"FedoraResource",
">",
"idTranslator",
",",
"final",
"String",
"originalPath",
")",
"{",
"final",
"Resource",
"resource",
"=",
"idTranslator",
".",
"toDomain",
"(",
... | Convert a JAX-RS list of PathSegments to a JCR path
@param idTranslator the id translator
@param originalPath the original path
@return String jcr path | [
"Convert",
"a",
"JAX",
"-",
"RS",
"list",
"of",
"PathSegments",
"to",
"a",
"JCR",
"path"
] | 7489ad5bc8fb44e2442c93eceb7d97ac54553ab6 | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-http-commons/src/main/java/org/fcrepo/http/commons/AbstractResource.java#L108-L116 |
102,820 | fcrepo4/fcrepo4 | fcrepo-kernel-modeshape/src/main/java/org/fcrepo/kernel/modeshape/utils/impl/CacheEntryFactory.java | CacheEntryFactory.forProperty | public static CacheEntry forProperty(final Property property) throws RepositoryException {
// if it's an external binary, catch that here and treat it differently.
if (property.getName().endsWith(PROXY_FOR.getLocalName()) ||
property.getName().endsWith(REDIRECTS_TO.getLocalName())) {
... | java | public static CacheEntry forProperty(final Property property) throws RepositoryException {
// if it's an external binary, catch that here and treat it differently.
if (property.getName().endsWith(PROXY_FOR.getLocalName()) ||
property.getName().endsWith(REDIRECTS_TO.getLocalName())) {
... | [
"public",
"static",
"CacheEntry",
"forProperty",
"(",
"final",
"Property",
"property",
")",
"throws",
"RepositoryException",
"{",
"// if it's an external binary, catch that here and treat it differently.",
"if",
"(",
"property",
".",
"getName",
"(",
")",
".",
"endsWith",
... | Load a store-specific CacheEntry model
@param property the property
@return CacheEntry model for the property in the given repository
@throws RepositoryException if repository exception occurred | [
"Load",
"a",
"store",
"-",
"specific",
"CacheEntry",
"model"
] | 7489ad5bc8fb44e2442c93eceb7d97ac54553ab6 | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-kernel-modeshape/src/main/java/org/fcrepo/kernel/modeshape/utils/impl/CacheEntryFactory.java#L55-L70 |
102,821 | fcrepo4/fcrepo4 | fcrepo-kernel-modeshape/src/main/java/org/fcrepo/kernel/modeshape/services/VersionServiceImpl.java | VersionServiceImpl.remapResourceUris | private RdfStream remapResourceUris(final String resourceUri,
final String mementoUri,
final RdfStream rdfStream,
final IdentifierConverter<Resource, FedoraResource> idTranslator,
final Session jcrSession) {
final IdentifierConverter<Resource, FedoraResource> inte... | java | private RdfStream remapResourceUris(final String resourceUri,
final String mementoUri,
final RdfStream rdfStream,
final IdentifierConverter<Resource, FedoraResource> idTranslator,
final Session jcrSession) {
final IdentifierConverter<Resource, FedoraResource> inte... | [
"private",
"RdfStream",
"remapResourceUris",
"(",
"final",
"String",
"resourceUri",
",",
"final",
"String",
"mementoUri",
",",
"final",
"RdfStream",
"rdfStream",
",",
"final",
"IdentifierConverter",
"<",
"Resource",
",",
"FedoraResource",
">",
"idTranslator",
",",
"... | Remaps the subjects of triples in rdfStream from the original resource URL to the URL of the new memento, and
converts objects which reference resources to an internal identifier to prevent enforcement of referential
integrity constraints.
@param resourceUri uri of the original resource
@param mementoUri uri of the me... | [
"Remaps",
"the",
"subjects",
"of",
"triples",
"in",
"rdfStream",
"from",
"the",
"original",
"resource",
"URL",
"to",
"the",
"URL",
"of",
"the",
"new",
"memento",
"and",
"converts",
"objects",
"which",
"reference",
"resources",
"to",
"an",
"internal",
"identifi... | 7489ad5bc8fb44e2442c93eceb7d97ac54553ab6 | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-kernel-modeshape/src/main/java/org/fcrepo/kernel/modeshape/services/VersionServiceImpl.java#L213-L225 |
102,822 | fcrepo4/fcrepo4 | fcrepo-kernel-modeshape/src/main/java/org/fcrepo/kernel/modeshape/services/VersionServiceImpl.java | VersionServiceImpl.convertToInternalReference | private Triple convertToInternalReference(final Triple t,
final IdentifierConverter<Resource, FedoraResource> idTranslator,
final IdentifierConverter<Resource, FedoraResource> internalIdTranslator) {
if (t.getObject().isURI()) {
final Resource object = createResource(t.getObj... | java | private Triple convertToInternalReference(final Triple t,
final IdentifierConverter<Resource, FedoraResource> idTranslator,
final IdentifierConverter<Resource, FedoraResource> internalIdTranslator) {
if (t.getObject().isURI()) {
final Resource object = createResource(t.getObj... | [
"private",
"Triple",
"convertToInternalReference",
"(",
"final",
"Triple",
"t",
",",
"final",
"IdentifierConverter",
"<",
"Resource",
",",
"FedoraResource",
">",
"idTranslator",
",",
"final",
"IdentifierConverter",
"<",
"Resource",
",",
"FedoraResource",
">",
"interna... | Convert the referencing resource uri to un-dereferenceable internal identifier.
@param t the Triple to convert
@param idTranslator the Converter that convert the resource uri to a path
@param internalIdTranslator the Converter that convert a path to internal identifier
@return Triple a triple with referencing resource... | [
"Convert",
"the",
"referencing",
"resource",
"uri",
"to",
"un",
"-",
"dereferenceable",
"internal",
"identifier",
"."
] | 7489ad5bc8fb44e2442c93eceb7d97ac54553ab6 | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-kernel-modeshape/src/main/java/org/fcrepo/kernel/modeshape/services/VersionServiceImpl.java#L235-L251 |
102,823 | fcrepo4/fcrepo4 | fcrepo-http-commons/src/main/java/org/fcrepo/http/commons/session/SessionFactory.java | SessionFactory.getSession | public HttpSession getSession(final HttpServletRequest servletRequest) {
final HttpSession session;
final String txId = getEmbeddedId(servletRequest, Prefix.TX);
try {
if (txId == null) {
session = createSession(servletRequest);
} else {
s... | java | public HttpSession getSession(final HttpServletRequest servletRequest) {
final HttpSession session;
final String txId = getEmbeddedId(servletRequest, Prefix.TX);
try {
if (txId == null) {
session = createSession(servletRequest);
} else {
s... | [
"public",
"HttpSession",
"getSession",
"(",
"final",
"HttpServletRequest",
"servletRequest",
")",
"{",
"final",
"HttpSession",
"session",
";",
"final",
"String",
"txId",
"=",
"getEmbeddedId",
"(",
"servletRequest",
",",
"Prefix",
".",
"TX",
")",
";",
"try",
"{",... | Get a JCR session for the given HTTP servlet request with a
SecurityContext attached
@param servletRequest the servlet request
@return the Session
@throws RuntimeException if the transaction could not be found | [
"Get",
"a",
"JCR",
"session",
"for",
"the",
"given",
"HTTP",
"servlet",
"request",
"with",
"a",
"SecurityContext",
"attached"
] | 7489ad5bc8fb44e2442c93eceb7d97ac54553ab6 | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-http-commons/src/main/java/org/fcrepo/http/commons/session/SessionFactory.java#L108-L124 |
102,824 | fcrepo4/fcrepo4 | fcrepo-http-commons/src/main/java/org/fcrepo/http/commons/session/SessionFactory.java | SessionFactory.createSession | protected HttpSession createSession(final HttpServletRequest servletRequest) {
LOGGER.debug("Returning an authenticated session in the default workspace");
return new HttpSession(repo.login(credentialsService.getCredentials(servletRequest)));
} | java | protected HttpSession createSession(final HttpServletRequest servletRequest) {
LOGGER.debug("Returning an authenticated session in the default workspace");
return new HttpSession(repo.login(credentialsService.getCredentials(servletRequest)));
} | [
"protected",
"HttpSession",
"createSession",
"(",
"final",
"HttpServletRequest",
"servletRequest",
")",
"{",
"LOGGER",
".",
"debug",
"(",
"\"Returning an authenticated session in the default workspace\"",
")",
";",
"return",
"new",
"HttpSession",
"(",
"repo",
".",
"login"... | Create a JCR session for the given HTTP servlet request with a
SecurityContext attached.
@param servletRequest the servlet request
@return a newly created JCR session | [
"Create",
"a",
"JCR",
"session",
"for",
"the",
"given",
"HTTP",
"servlet",
"request",
"with",
"a",
"SecurityContext",
"attached",
"."
] | 7489ad5bc8fb44e2442c93eceb7d97ac54553ab6 | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-http-commons/src/main/java/org/fcrepo/http/commons/session/SessionFactory.java#L133-L137 |
102,825 | fcrepo4/fcrepo4 | fcrepo-http-commons/src/main/java/org/fcrepo/http/commons/session/SessionFactory.java | SessionFactory.getSessionFromTransaction | protected HttpSession getSessionFromTransaction(final HttpServletRequest servletRequest, final String txId) {
final Principal userPrincipal = servletRequest.getUserPrincipal();
final String userName = userPrincipal == null ? null : userPrincipal.getName();
final FedoraSession session = batchSe... | java | protected HttpSession getSessionFromTransaction(final HttpServletRequest servletRequest, final String txId) {
final Principal userPrincipal = servletRequest.getUserPrincipal();
final String userName = userPrincipal == null ? null : userPrincipal.getName();
final FedoraSession session = batchSe... | [
"protected",
"HttpSession",
"getSessionFromTransaction",
"(",
"final",
"HttpServletRequest",
"servletRequest",
",",
"final",
"String",
"txId",
")",
"{",
"final",
"Principal",
"userPrincipal",
"=",
"servletRequest",
".",
"getUserPrincipal",
"(",
")",
";",
"final",
"Str... | Retrieve a JCR session from an active transaction
@param servletRequest the servlet request
@param txId the transaction id
@return a JCR session that is associated with the transaction | [
"Retrieve",
"a",
"JCR",
"session",
"from",
"an",
"active",
"transaction"
] | 7489ad5bc8fb44e2442c93eceb7d97ac54553ab6 | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-http-commons/src/main/java/org/fcrepo/http/commons/session/SessionFactory.java#L146-L156 |
102,826 | fcrepo4/fcrepo4 | fcrepo-http-commons/src/main/java/org/fcrepo/http/commons/session/SessionFactory.java | SessionFactory.getEmbeddedId | protected String getEmbeddedId(
final HttpServletRequest servletRequest, final Prefix prefix) {
String requestPath = servletRequest.getPathInfo();
// http://stackoverflow.com/questions/18963562/grizzlys-request-getpathinfo-returns-always-null
if (requestPath == null && servletReques... | java | protected String getEmbeddedId(
final HttpServletRequest servletRequest, final Prefix prefix) {
String requestPath = servletRequest.getPathInfo();
// http://stackoverflow.com/questions/18963562/grizzlys-request-getpathinfo-returns-always-null
if (requestPath == null && servletReques... | [
"protected",
"String",
"getEmbeddedId",
"(",
"final",
"HttpServletRequest",
"servletRequest",
",",
"final",
"Prefix",
"prefix",
")",
"{",
"String",
"requestPath",
"=",
"servletRequest",
".",
"getPathInfo",
"(",
")",
";",
"// http://stackoverflow.com/questions/18963562/gri... | Extract the id embedded at the beginning of a request path
@param servletRequest the servlet request
@param prefix the prefix for the id
@return the found id or null | [
"Extract",
"the",
"id",
"embedded",
"at",
"the",
"beginning",
"of",
"a",
"request",
"path"
] | 7489ad5bc8fb44e2442c93eceb7d97ac54553ab6 | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-http-commons/src/main/java/org/fcrepo/http/commons/session/SessionFactory.java#L165-L183 |
102,827 | fcrepo4/fcrepo4 | fcrepo-kernel-api/src/main/java/org/fcrepo/kernel/api/utils/GraphDifferencer.java | GraphDifferencer.common | public Stream<Triple> common() {
return stream(spliteratorUnknownSize(common.find(ANY, ANY, ANY), IMMUTABLE), false);
} | java | public Stream<Triple> common() {
return stream(spliteratorUnknownSize(common.find(ANY, ANY, ANY), IMMUTABLE), false);
} | [
"public",
"Stream",
"<",
"Triple",
">",
"common",
"(",
")",
"{",
"return",
"stream",
"(",
"spliteratorUnknownSize",
"(",
"common",
".",
"find",
"(",
"ANY",
",",
"ANY",
",",
"ANY",
")",
",",
"IMMUTABLE",
")",
",",
"false",
")",
";",
"}"
] | This method will return null until the source iterator is exhausted.
@return The elements that turned out to be common to the two inputs. | [
"This",
"method",
"will",
"return",
"null",
"until",
"the",
"source",
"iterator",
"is",
"exhausted",
"."
] | 7489ad5bc8fb44e2442c93eceb7d97ac54553ab6 | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-kernel-api/src/main/java/org/fcrepo/kernel/api/utils/GraphDifferencer.java#L97-L99 |
102,828 | fcrepo4/fcrepo4 | fcrepo-http-commons/src/main/java/org/fcrepo/http/commons/api/rdf/HttpTripleUtil.java | HttpTripleUtil.addHttpComponentModelsForResourceToStream | public RdfStream addHttpComponentModelsForResourceToStream(final RdfStream rdfStream,
final FedoraResource resource, final UriInfo uriInfo,
final IdentifierConverter<Resource,FedoraResource> idTranslator) {
LOGGER.debug("Adding additional HTTP context triples to stream");
return... | java | public RdfStream addHttpComponentModelsForResourceToStream(final RdfStream rdfStream,
final FedoraResource resource, final UriInfo uriInfo,
final IdentifierConverter<Resource,FedoraResource> idTranslator) {
LOGGER.debug("Adding additional HTTP context triples to stream");
return... | [
"public",
"RdfStream",
"addHttpComponentModelsForResourceToStream",
"(",
"final",
"RdfStream",
"rdfStream",
",",
"final",
"FedoraResource",
"resource",
",",
"final",
"UriInfo",
"uriInfo",
",",
"final",
"IdentifierConverter",
"<",
"Resource",
",",
"FedoraResource",
">",
... | Add additional models to the RDF dataset for the given resource
@param rdfStream the source stream we'll add named models to
@param resource the FedoraResourceImpl in question
@param uriInfo a JAX-RS UriInfo object to build URIs to resources
@param idTranslator the id translator
@return an RdfStream with the added tri... | [
"Add",
"additional",
"models",
"to",
"the",
"RDF",
"dataset",
"for",
"the",
"given",
"resource"
] | 7489ad5bc8fb44e2442c93eceb7d97ac54553ab6 | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-http-commons/src/main/java/org/fcrepo/http/commons/api/rdf/HttpTripleUtil.java#L70-L81 |
102,829 | fcrepo4/fcrepo4 | fcrepo-event-serialization/src/main/java/org/fcrepo/event/serialization/JsonLDSerializer.java | JsonLDSerializer.serialize | @Override
public String serialize(final FedoraEvent evt) {
try {
return MAPPER.writeValueAsString(from(evt));
} catch (final JsonProcessingException ex) {
LOGGER.error("Error processing JSON: {}", ex.getMessage());
return null;
}
} | java | @Override
public String serialize(final FedoraEvent evt) {
try {
return MAPPER.writeValueAsString(from(evt));
} catch (final JsonProcessingException ex) {
LOGGER.error("Error processing JSON: {}", ex.getMessage());
return null;
}
} | [
"@",
"Override",
"public",
"String",
"serialize",
"(",
"final",
"FedoraEvent",
"evt",
")",
"{",
"try",
"{",
"return",
"MAPPER",
".",
"writeValueAsString",
"(",
"from",
"(",
"evt",
")",
")",
";",
"}",
"catch",
"(",
"final",
"JsonProcessingException",
"ex",
... | Serialize a FedoraEvent into a JSON String
@param evt the Fedora event
@return a JSON string | [
"Serialize",
"a",
"FedoraEvent",
"into",
"a",
"JSON",
"String"
] | 7489ad5bc8fb44e2442c93eceb7d97ac54553ab6 | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-event-serialization/src/main/java/org/fcrepo/event/serialization/JsonLDSerializer.java#L54-L62 |
102,830 | fcrepo4/fcrepo4 | fcrepo-kernel-modeshape/src/main/java/org/fcrepo/kernel/modeshape/rdf/converters/PropertyConverter.java | PropertyConverter.getPropertyNameFromPredicate | private static String getPropertyNameFromPredicate(final NamespaceRegistry namespaceRegistry,
final Resource predicate,
final Map<String, String> namespaceMapping)
throws RepositoryException {
... | java | private static String getPropertyNameFromPredicate(final NamespaceRegistry namespaceRegistry,
final Resource predicate,
final Map<String, String> namespaceMapping)
throws RepositoryException {
... | [
"private",
"static",
"String",
"getPropertyNameFromPredicate",
"(",
"final",
"NamespaceRegistry",
"namespaceRegistry",
",",
"final",
"Resource",
"predicate",
",",
"final",
"Map",
"<",
"String",
",",
"String",
">",
"namespaceMapping",
")",
"throws",
"RepositoryException"... | Get the JCR property name for an RDF predicate
@param namespaceRegistry the namespace registry
@param predicate the predicate to map to a property name
@param namespaceMapping the namespace mapping
@return JCR property name for an RDF predicate
@throws RepositoryException if repository exception occurred | [
"Get",
"the",
"JCR",
"property",
"name",
"for",
"an",
"RDF",
"predicate"
] | 7489ad5bc8fb44e2442c93eceb7d97ac54553ab6 | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-kernel-modeshape/src/main/java/org/fcrepo/kernel/modeshape/rdf/converters/PropertyConverter.java#L113-L164 |
102,831 | fcrepo4/fcrepo4 | fcrepo-http-api/src/main/java/org/fcrepo/http/api/ContentExposingResource.java | ContentExposingResource.getContent | protected Response getContent(final String rangeValue,
final int limit,
final RdfStream rdfStream,
final FedoraResource resource) throws IOException {
final RdfNamespacedStream outputStream;
if (resou... | java | protected Response getContent(final String rangeValue,
final int limit,
final RdfStream rdfStream,
final FedoraResource resource) throws IOException {
final RdfNamespacedStream outputStream;
if (resou... | [
"protected",
"Response",
"getContent",
"(",
"final",
"String",
"rangeValue",
",",
"final",
"int",
"limit",
",",
"final",
"RdfStream",
"rdfStream",
",",
"final",
"FedoraResource",
"resource",
")",
"throws",
"IOException",
"{",
"final",
"RdfNamespacedStream",
"outputS... | This method returns an HTTP response with content body appropriate to the following arguments.
@param rangeValue starting and ending byte offsets, see {@link Range}
@param limit is the number of child resources returned in the response, -1 for all
@param rdfStream to which response RDF will be concatenated
@param reso... | [
"This",
"method",
"returns",
"an",
"HTTP",
"response",
"with",
"content",
"body",
"appropriate",
"to",
"the",
"following",
"arguments",
"."
] | 7489ad5bc8fb44e2442c93eceb7d97ac54553ab6 | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-http-api/src/main/java/org/fcrepo/http/api/ContentExposingResource.java#L263-L280 |
102,832 | fcrepo4/fcrepo4 | fcrepo-http-api/src/main/java/org/fcrepo/http/api/ContentExposingResource.java | ContentExposingResource.getResourceTriples | private RdfStream getResourceTriples(final int limit, final FedoraResource resource) {
final PreferTag returnPreference;
if (prefer != null && prefer.hasReturn()) {
returnPreference = prefer.getReturn();
} else if (prefer != null && prefer.hasHandling()) {
returnPrefere... | java | private RdfStream getResourceTriples(final int limit, final FedoraResource resource) {
final PreferTag returnPreference;
if (prefer != null && prefer.hasReturn()) {
returnPreference = prefer.getReturn();
} else if (prefer != null && prefer.hasHandling()) {
returnPrefere... | [
"private",
"RdfStream",
"getResourceTriples",
"(",
"final",
"int",
"limit",
",",
"final",
"FedoraResource",
"resource",
")",
"{",
"final",
"PreferTag",
"returnPreference",
";",
"if",
"(",
"prefer",
"!=",
"null",
"&&",
"prefer",
".",
"hasReturn",
"(",
")",
")",... | This method returns a stream of RDF triples associated with this target resource
@param limit is the number of child resources returned in the response, -1 for all
@param resource the fedora resource
@return {@link RdfStream} | [
"This",
"method",
"returns",
"a",
"stream",
"of",
"RDF",
"triples",
"associated",
"with",
"this",
"target",
"resource"
] | 7489ad5bc8fb44e2442c93eceb7d97ac54553ab6 | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-http-api/src/main/java/org/fcrepo/http/api/ContentExposingResource.java#L313-L385 |
102,833 | fcrepo4/fcrepo4 | fcrepo-http-api/src/main/java/org/fcrepo/http/api/ContentExposingResource.java | ContentExposingResource.getBinaryContent | private Response getBinaryContent(final String rangeValue, final FedoraResource resource)
throws IOException {
final FedoraBinary binary = (FedoraBinary)resource;
final CacheControl cc = new CacheControl();
cc.setMaxAge(0);
cc.setMustRevalidate(true);
... | java | private Response getBinaryContent(final String rangeValue, final FedoraResource resource)
throws IOException {
final FedoraBinary binary = (FedoraBinary)resource;
final CacheControl cc = new CacheControl();
cc.setMaxAge(0);
cc.setMustRevalidate(true);
... | [
"private",
"Response",
"getBinaryContent",
"(",
"final",
"String",
"rangeValue",
",",
"final",
"FedoraResource",
"resource",
")",
"throws",
"IOException",
"{",
"final",
"FedoraBinary",
"binary",
"=",
"(",
"FedoraBinary",
")",
"resource",
";",
"final",
"CacheControl"... | Get the binary content of a datastream
@param rangeValue the range value
@param resource the fedora resource
@return Binary blob
@throws IOException if io exception occurred | [
"Get",
"the",
"binary",
"content",
"of",
"a",
"datastream"
] | 7489ad5bc8fb44e2442c93eceb7d97ac54553ab6 | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-http-api/src/main/java/org/fcrepo/http/api/ContentExposingResource.java#L395-L450 |
102,834 | fcrepo4/fcrepo4 | fcrepo-http-api/src/main/java/org/fcrepo/http/api/ContentExposingResource.java | ContentExposingResource.addAcceptPostHeader | private void addAcceptPostHeader() {
final String rdfTypes = TURTLE + "," + N3 + "," + N3_ALT2 + "," + RDF_XML + "," + NTRIPLES + "," + JSON_LD;
servletResponse.addHeader("Accept-Post", rdfTypes);
} | java | private void addAcceptPostHeader() {
final String rdfTypes = TURTLE + "," + N3 + "," + N3_ALT2 + "," + RDF_XML + "," + NTRIPLES + "," + JSON_LD;
servletResponse.addHeader("Accept-Post", rdfTypes);
} | [
"private",
"void",
"addAcceptPostHeader",
"(",
")",
"{",
"final",
"String",
"rdfTypes",
"=",
"TURTLE",
"+",
"\",\"",
"+",
"N3",
"+",
"\",\"",
"+",
"N3_ALT2",
"+",
"\",\"",
"+",
"RDF_XML",
"+",
"\",\"",
"+",
"NTRIPLES",
"+",
"\",\"",
"+",
"JSON_LD",
";",
... | Add the standard Accept-Post header, for reuse. | [
"Add",
"the",
"standard",
"Accept",
"-",
"Post",
"header",
"for",
"reuse",
"."
] | 7489ad5bc8fb44e2442c93eceb7d97ac54553ab6 | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-http-api/src/main/java/org/fcrepo/http/api/ContentExposingResource.java#L479-L482 |
102,835 | fcrepo4/fcrepo4 | fcrepo-http-api/src/main/java/org/fcrepo/http/api/ContentExposingResource.java | ContentExposingResource.addLinkAndOptionsHttpHeaders | protected void addLinkAndOptionsHttpHeaders(final FedoraResource resource) {
// Add Link headers
addResourceLinkHeaders(resource);
addAcceptExternalHeader();
// Add Options headers
final String options;
if (resource.isMemento()) {
options = "GET,HEAD,OPTIONS,... | java | protected void addLinkAndOptionsHttpHeaders(final FedoraResource resource) {
// Add Link headers
addResourceLinkHeaders(resource);
addAcceptExternalHeader();
// Add Options headers
final String options;
if (resource.isMemento()) {
options = "GET,HEAD,OPTIONS,... | [
"protected",
"void",
"addLinkAndOptionsHttpHeaders",
"(",
"final",
"FedoraResource",
"resource",
")",
"{",
"// Add Link headers",
"addResourceLinkHeaders",
"(",
"resource",
")",
";",
"addAcceptExternalHeader",
"(",
")",
";",
"// Add Options headers",
"final",
"String",
"o... | Add Link and Option headers
@param resource the resource to generate headers for | [
"Add",
"Link",
"and",
"Option",
"headers"
] | 7489ad5bc8fb44e2442c93eceb7d97ac54553ab6 | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-http-api/src/main/java/org/fcrepo/http/api/ContentExposingResource.java#L589-L616 |
102,836 | fcrepo4/fcrepo4 | fcrepo-http-api/src/main/java/org/fcrepo/http/api/ContentExposingResource.java | ContentExposingResource.unpackLinks | protected List<String> unpackLinks(final List<String> rawLinks) {
if (rawLinks == null) {
return null;
}
return rawLinks.stream()
.flatMap(x -> Arrays.stream(x.split(",")))
.collect(Collectors.toList());
} | java | protected List<String> unpackLinks(final List<String> rawLinks) {
if (rawLinks == null) {
return null;
}
return rawLinks.stream()
.flatMap(x -> Arrays.stream(x.split(",")))
.collect(Collectors.toList());
} | [
"protected",
"List",
"<",
"String",
">",
"unpackLinks",
"(",
"final",
"List",
"<",
"String",
">",
"rawLinks",
")",
"{",
"if",
"(",
"rawLinks",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"return",
"rawLinks",
".",
"stream",
"(",
")",
".",
"fl... | Multi-value Link header values parsed by the javax.ws.rs.core are not split out by the framework Therefore we
must do this ourselves.
@param rawLinks the list of unprocessed links
@return List of strings containing one link value per string. | [
"Multi",
"-",
"value",
"Link",
"header",
"values",
"parsed",
"by",
"the",
"javax",
".",
"ws",
".",
"rs",
".",
"core",
"are",
"not",
"split",
"out",
"by",
"the",
"framework",
"Therefore",
"we",
"must",
"do",
"this",
"ourselves",
"."
] | 7489ad5bc8fb44e2442c93eceb7d97ac54553ab6 | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-http-api/src/main/java/org/fcrepo/http/api/ContentExposingResource.java#L647-L655 |
102,837 | fcrepo4/fcrepo4 | fcrepo-http-api/src/main/java/org/fcrepo/http/api/ContentExposingResource.java | ContentExposingResource.addResourceHttpHeaders | protected void addResourceHttpHeaders(final FedoraResource resource) {
if (resource instanceof FedoraBinary) {
final FedoraBinary binary = (FedoraBinary)resource;
final Date createdDate = binary.getCreatedDate() != null ? Date.from(binary.getCreatedDate()) : null;
final Date ... | java | protected void addResourceHttpHeaders(final FedoraResource resource) {
if (resource instanceof FedoraBinary) {
final FedoraBinary binary = (FedoraBinary)resource;
final Date createdDate = binary.getCreatedDate() != null ? Date.from(binary.getCreatedDate()) : null;
final Date ... | [
"protected",
"void",
"addResourceHttpHeaders",
"(",
"final",
"FedoraResource",
"resource",
")",
"{",
"if",
"(",
"resource",
"instanceof",
"FedoraBinary",
")",
"{",
"final",
"FedoraBinary",
"binary",
"=",
"(",
"FedoraBinary",
")",
"resource",
";",
"final",
"Date",
... | Add any resource-specific headers to the response
@param resource the resource | [
"Add",
"any",
"resource",
"-",
"specific",
"headers",
"to",
"the",
"response"
] | 7489ad5bc8fb44e2442c93eceb7d97ac54553ab6 | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-http-api/src/main/java/org/fcrepo/http/api/ContentExposingResource.java#L661-L709 |
102,838 | fcrepo4/fcrepo4 | fcrepo-http-api/src/main/java/org/fcrepo/http/api/ContentExposingResource.java | ContentExposingResource.checkCacheControlHeaders | protected void checkCacheControlHeaders(final Request request,
final HttpServletResponse servletResponse,
final FedoraResource resource,
final HttpSession session) {
... | java | protected void checkCacheControlHeaders(final Request request,
final HttpServletResponse servletResponse,
final FedoraResource resource,
final HttpSession session) {
... | [
"protected",
"void",
"checkCacheControlHeaders",
"(",
"final",
"Request",
"request",
",",
"final",
"HttpServletResponse",
"servletResponse",
",",
"final",
"FedoraResource",
"resource",
",",
"final",
"HttpSession",
"session",
")",
"{",
"evaluateRequestPreconditions",
"(",
... | Evaluate the cache control headers for the request to see if it can be served from
the cache.
@param request the request
@param servletResponse the servlet response
@param resource the fedora resource
@param session the session | [
"Evaluate",
"the",
"cache",
"control",
"headers",
"for",
"the",
"request",
"to",
"see",
"if",
"it",
"can",
"be",
"served",
"from",
"the",
"cache",
"."
] | 7489ad5bc8fb44e2442c93eceb7d97ac54553ab6 | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-http-api/src/main/java/org/fcrepo/http/api/ContentExposingResource.java#L720-L726 |
102,839 | fcrepo4/fcrepo4 | fcrepo-http-api/src/main/java/org/fcrepo/http/api/ContentExposingResource.java | ContentExposingResource.evaluateRequestPreconditions | protected void evaluateRequestPreconditions(final Request request,
final HttpServletResponse servletResponse,
final FedoraResource resource,
final HttpSess... | java | protected void evaluateRequestPreconditions(final Request request,
final HttpServletResponse servletResponse,
final FedoraResource resource,
final HttpSess... | [
"protected",
"void",
"evaluateRequestPreconditions",
"(",
"final",
"Request",
"request",
",",
"final",
"HttpServletResponse",
"servletResponse",
",",
"final",
"FedoraResource",
"resource",
",",
"final",
"HttpSession",
"session",
")",
"{",
"evaluateRequestPreconditions",
"... | Evaluate request preconditions to ensure the resource is the expected state
@param request the request
@param servletResponse the servlet response
@param resource the resource
@param session the session | [
"Evaluate",
"request",
"preconditions",
"to",
"ensure",
"the",
"resource",
"is",
"the",
"expected",
"state"
] | 7489ad5bc8fb44e2442c93eceb7d97ac54553ab6 | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-http-api/src/main/java/org/fcrepo/http/api/ContentExposingResource.java#L788-L793 |
102,840 | fcrepo4/fcrepo4 | fcrepo-http-api/src/main/java/org/fcrepo/http/api/ContentExposingResource.java | ContentExposingResource.acceptabePlainTextMediaType | private MediaType acceptabePlainTextMediaType() {
final List<MediaType> acceptable = headers.getAcceptableMediaTypes();
if (acceptable == null || acceptable.size() == 0) {
return TEXT_PLAIN_TYPE;
}
for (final MediaType type : acceptable) {
if (type.isWildcardType(... | java | private MediaType acceptabePlainTextMediaType() {
final List<MediaType> acceptable = headers.getAcceptableMediaTypes();
if (acceptable == null || acceptable.size() == 0) {
return TEXT_PLAIN_TYPE;
}
for (final MediaType type : acceptable) {
if (type.isWildcardType(... | [
"private",
"MediaType",
"acceptabePlainTextMediaType",
"(",
")",
"{",
"final",
"List",
"<",
"MediaType",
">",
"acceptable",
"=",
"headers",
".",
"getAcceptableMediaTypes",
"(",
")",
";",
"if",
"(",
"acceptable",
"==",
"null",
"||",
"acceptable",
".",
"size",
"... | Returns an acceptable plain text media type if possible, or null if not.
@return an acceptable plain-text media type, or null | [
"Returns",
"an",
"acceptable",
"plain",
"text",
"media",
"type",
"if",
"possible",
"or",
"null",
"if",
"not",
"."
] | 7489ad5bc8fb44e2442c93eceb7d97ac54553ab6 | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-http-api/src/main/java/org/fcrepo/http/api/ContentExposingResource.java#L856-L869 |
102,841 | fcrepo4/fcrepo4 | fcrepo-http-api/src/main/java/org/fcrepo/http/api/ContentExposingResource.java | ContentExposingResource.createUpdateResponse | @SuppressWarnings("resource")
protected Response createUpdateResponse(final FedoraResource resource, final boolean created) {
addCacheControlHeaders(servletResponse, resource, session);
addResourceLinkHeaders(resource, created);
addExternalContentHeaders(resource);
addAclHeader(resou... | java | @SuppressWarnings("resource")
protected Response createUpdateResponse(final FedoraResource resource, final boolean created) {
addCacheControlHeaders(servletResponse, resource, session);
addResourceLinkHeaders(resource, created);
addExternalContentHeaders(resource);
addAclHeader(resou... | [
"@",
"SuppressWarnings",
"(",
"\"resource\"",
")",
"protected",
"Response",
"createUpdateResponse",
"(",
"final",
"FedoraResource",
"resource",
",",
"final",
"boolean",
"created",
")",
"{",
"addCacheControlHeaders",
"(",
"servletResponse",
",",
"resource",
",",
"sessi... | Create the appropriate response after a create or update request is processed. When a resource is created,
examine the Prefer and Accept headers to determine whether to include a representation. By default, the URI for
the created resource is return as plain text. If a minimal response is requested, then no body is ret... | [
"Create",
"the",
"appropriate",
"response",
"after",
"a",
"create",
"or",
"update",
"request",
"is",
"processed",
".",
"When",
"a",
"resource",
"is",
"created",
"examine",
"the",
"Prefer",
"and",
"Accept",
"headers",
"to",
"determine",
"whether",
"to",
"includ... | 7489ad5bc8fb44e2442c93eceb7d97ac54553ab6 | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-http-api/src/main/java/org/fcrepo/http/api/ContentExposingResource.java#L882-L914 |
102,842 | fcrepo4/fcrepo4 | fcrepo-http-api/src/main/java/org/fcrepo/http/api/ContentExposingResource.java | ContentExposingResource.parseBodyAsModel | private Model parseBodyAsModel(final InputStream requestBodyStream,
final MediaType contentType, final FedoraResource resource) throws MalformedRdfException {
final Lang format = contentTypeToLang(contentType.toString());
final Model inputModel;
try {
inputModel = create... | java | private Model parseBodyAsModel(final InputStream requestBodyStream,
final MediaType contentType, final FedoraResource resource) throws MalformedRdfException {
final Lang format = contentTypeToLang(contentType.toString());
final Model inputModel;
try {
inputModel = create... | [
"private",
"Model",
"parseBodyAsModel",
"(",
"final",
"InputStream",
"requestBodyStream",
",",
"final",
"MediaType",
"contentType",
",",
"final",
"FedoraResource",
"resource",
")",
"throws",
"MalformedRdfException",
"{",
"final",
"Lang",
"format",
"=",
"contentTypeToLan... | Parse the request body as a Model.
@param requestBodyStream rdf request body
@param contentType content type of body
@param resource the fedora resource
@return Model containing triples from request body
@throws MalformedRdfException in case rdf json cannot be parsed | [
"Parse",
"the",
"request",
"body",
"as",
"a",
"Model",
"."
] | 7489ad5bc8fb44e2442c93eceb7d97ac54553ab6 | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-http-api/src/main/java/org/fcrepo/http/api/ContentExposingResource.java#L975-L993 |
102,843 | fcrepo4/fcrepo4 | fcrepo-http-api/src/main/java/org/fcrepo/http/api/ContentExposingResource.java | ContentExposingResource.createDefaultAccessToStatement | private Statement createDefaultAccessToStatement(final String authSubject) {
final String currentResourcePath = authSubject.substring(0, authSubject.indexOf("/" + FCR_ACL));
return createStatement(
createResource(authSubject),
WEBAC_ACCESS_TO_PROPERTY,
... | java | private Statement createDefaultAccessToStatement(final String authSubject) {
final String currentResourcePath = authSubject.substring(0, authSubject.indexOf("/" + FCR_ACL));
return createStatement(
createResource(authSubject),
WEBAC_ACCESS_TO_PROPERTY,
... | [
"private",
"Statement",
"createDefaultAccessToStatement",
"(",
"final",
"String",
"authSubject",
")",
"{",
"final",
"String",
"currentResourcePath",
"=",
"authSubject",
".",
"substring",
"(",
"0",
",",
"authSubject",
".",
"indexOf",
"(",
"\"/\"",
"+",
"FCR_ACL",
"... | Returns a Statement with the resource containing the acl to be the accessTo target for the given auth subject.
@param authSubject - acl authorization subject uri string
@return acl statement | [
"Returns",
"a",
"Statement",
"with",
"the",
"resource",
"containing",
"the",
"acl",
"to",
"be",
"the",
"accessTo",
"target",
"for",
"the",
"given",
"auth",
"subject",
"."
] | 7489ad5bc8fb44e2442c93eceb7d97ac54553ab6 | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-http-api/src/main/java/org/fcrepo/http/api/ContentExposingResource.java#L1067-L1073 |
102,844 | fcrepo4/fcrepo4 | fcrepo-http-api/src/main/java/org/fcrepo/http/api/ContentExposingResource.java | ContentExposingResource.checksumURI | protected static URI checksumURI( final String checksum ) {
if (!isBlank(checksum)) {
return URI.create(checksum);
}
return null;
} | java | protected static URI checksumURI( final String checksum ) {
if (!isBlank(checksum)) {
return URI.create(checksum);
}
return null;
} | [
"protected",
"static",
"URI",
"checksumURI",
"(",
"final",
"String",
"checksum",
")",
"{",
"if",
"(",
"!",
"isBlank",
"(",
"checksum",
")",
")",
"{",
"return",
"URI",
".",
"create",
"(",
"checksum",
")",
";",
"}",
"return",
"null",
";",
"}"
] | Create a checksum URI object. | [
"Create",
"a",
"checksum",
"URI",
"object",
"."
] | 7489ad5bc8fb44e2442c93eceb7d97ac54553ab6 | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-http-api/src/main/java/org/fcrepo/http/api/ContentExposingResource.java#L1101-L1106 |
102,845 | fcrepo4/fcrepo4 | fcrepo-http-api/src/main/java/org/fcrepo/http/api/ContentExposingResource.java | ContentExposingResource.getChildrenLimit | protected int getChildrenLimit() {
final List<String> acceptHeaders = headers.getRequestHeader(ACCEPT);
if (acceptHeaders != null && acceptHeaders.size() > 0) {
final List<String> accept = Arrays.asList(acceptHeaders.get(0).split(","));
if (accept.contains(TEXT_HTML)) {
... | java | protected int getChildrenLimit() {
final List<String> acceptHeaders = headers.getRequestHeader(ACCEPT);
if (acceptHeaders != null && acceptHeaders.size() > 0) {
final List<String> accept = Arrays.asList(acceptHeaders.get(0).split(","));
if (accept.contains(TEXT_HTML)) {
... | [
"protected",
"int",
"getChildrenLimit",
"(",
")",
"{",
"final",
"List",
"<",
"String",
">",
"acceptHeaders",
"=",
"headers",
".",
"getRequestHeader",
"(",
"ACCEPT",
")",
";",
"if",
"(",
"acceptHeaders",
"!=",
"null",
"&&",
"acceptHeaders",
".",
"size",
"(",
... | Calculate the max number of children to display at once.
@return the limit of children to display. | [
"Calculate",
"the",
"max",
"number",
"of",
"children",
"to",
"display",
"at",
"once",
"."
] | 7489ad5bc8fb44e2442c93eceb7d97ac54553ab6 | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-http-api/src/main/java/org/fcrepo/http/api/ContentExposingResource.java#L1113-L1134 |
102,846 | fcrepo4/fcrepo4 | fcrepo-http-api/src/main/java/org/fcrepo/http/api/ContentExposingResource.java | ContentExposingResource.parseDigestHeader | protected static Collection<String> parseDigestHeader(final String digest) throws UnsupportedAlgorithmException {
try {
final Map<String, String> digestPairs = RFC3230_SPLITTER.split(nullToEmpty(digest));
final boolean allSupportedAlgorithms = digestPairs.keySet().stream().allMatch(
... | java | protected static Collection<String> parseDigestHeader(final String digest) throws UnsupportedAlgorithmException {
try {
final Map<String, String> digestPairs = RFC3230_SPLITTER.split(nullToEmpty(digest));
final boolean allSupportedAlgorithms = digestPairs.keySet().stream().allMatch(
... | [
"protected",
"static",
"Collection",
"<",
"String",
">",
"parseDigestHeader",
"(",
"final",
"String",
"digest",
")",
"throws",
"UnsupportedAlgorithmException",
"{",
"try",
"{",
"final",
"Map",
"<",
"String",
",",
"String",
">",
"digestPairs",
"=",
"RFC3230_SPLITTE... | Parse the RFC-3230 Digest response header value. Look for a sha1 checksum and return it as a urn, if missing or
malformed an empty string is returned.
@param digest The Digest header value
@return the sha1 checksum value
@throws UnsupportedAlgorithmException if an unsupported digest is used | [
"Parse",
"the",
"RFC",
"-",
"3230",
"Digest",
"response",
"header",
"value",
".",
"Look",
"for",
"a",
"sha1",
"checksum",
"and",
"return",
"it",
"as",
"a",
"urn",
"if",
"missing",
"or",
"malformed",
"an",
"empty",
"string",
"is",
"returned",
"."
] | 7489ad5bc8fb44e2442c93eceb7d97ac54553ab6 | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-http-api/src/main/java/org/fcrepo/http/api/ContentExposingResource.java#L1156-L1177 |
102,847 | fcrepo4/fcrepo4 | fcrepo-kernel-modeshape/src/main/java/org/fcrepo/kernel/modeshape/rdf/impl/RequiredPropertiesUtil.java | RequiredPropertiesUtil.assertRequiredContainerTriples | public static void assertRequiredContainerTriples(final Model model)
throws ConstraintViolationException {
assertContainsRequiredProperties(model, REQUIRED_PROPERTIES);
assertContainsRequiredTypes(model, CONTAINER_TYPES);
} | java | public static void assertRequiredContainerTriples(final Model model)
throws ConstraintViolationException {
assertContainsRequiredProperties(model, REQUIRED_PROPERTIES);
assertContainsRequiredTypes(model, CONTAINER_TYPES);
} | [
"public",
"static",
"void",
"assertRequiredContainerTriples",
"(",
"final",
"Model",
"model",
")",
"throws",
"ConstraintViolationException",
"{",
"assertContainsRequiredProperties",
"(",
"model",
",",
"REQUIRED_PROPERTIES",
")",
";",
"assertContainsRequiredTypes",
"(",
"mod... | Throws a ConstraintViolationException if the model does not contain all required server-managed triples for a
container.
@param model rdf to validate
@throws ConstraintViolationException if model does not contain all required server-managed triples for container | [
"Throws",
"a",
"ConstraintViolationException",
"if",
"the",
"model",
"does",
"not",
"contain",
"all",
"required",
"server",
"-",
"managed",
"triples",
"for",
"a",
"container",
"."
] | 7489ad5bc8fb44e2442c93eceb7d97ac54553ab6 | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-kernel-modeshape/src/main/java/org/fcrepo/kernel/modeshape/rdf/impl/RequiredPropertiesUtil.java#L66-L70 |
102,848 | fcrepo4/fcrepo4 | fcrepo-kernel-modeshape/src/main/java/org/fcrepo/kernel/modeshape/rdf/impl/RequiredPropertiesUtil.java | RequiredPropertiesUtil.assertRequiredDescriptionTriples | public static void assertRequiredDescriptionTriples(final Model model)
throws ConstraintViolationException {
assertContainsRequiredProperties(model, REQUIRED_PROPERTIES);
assertContainsRequiredTypes(model, BINARY_TYPES);
} | java | public static void assertRequiredDescriptionTriples(final Model model)
throws ConstraintViolationException {
assertContainsRequiredProperties(model, REQUIRED_PROPERTIES);
assertContainsRequiredTypes(model, BINARY_TYPES);
} | [
"public",
"static",
"void",
"assertRequiredDescriptionTriples",
"(",
"final",
"Model",
"model",
")",
"throws",
"ConstraintViolationException",
"{",
"assertContainsRequiredProperties",
"(",
"model",
",",
"REQUIRED_PROPERTIES",
")",
";",
"assertContainsRequiredTypes",
"(",
"m... | Throws a ConstraintViolationException if the model does not contain all required server-managed triples for a
binary description.
@param model rdf to validate
@throws ConstraintViolationException if model does not contain all required server-managed triples for binary
description | [
"Throws",
"a",
"ConstraintViolationException",
"if",
"the",
"model",
"does",
"not",
"contain",
"all",
"required",
"server",
"-",
"managed",
"triples",
"for",
"a",
"binary",
"description",
"."
] | 7489ad5bc8fb44e2442c93eceb7d97ac54553ab6 | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-kernel-modeshape/src/main/java/org/fcrepo/kernel/modeshape/rdf/impl/RequiredPropertiesUtil.java#L80-L84 |
102,849 | fcrepo4/fcrepo4 | fcrepo-kernel-modeshape/src/main/java/org/fcrepo/kernel/modeshape/services/BinaryServiceImpl.java | BinaryServiceImpl.find | @Override
public FedoraBinary find(final FedoraSession session, final String path) {
return cast(findNode(session, path));
} | java | @Override
public FedoraBinary find(final FedoraSession session, final String path) {
return cast(findNode(session, path));
} | [
"@",
"Override",
"public",
"FedoraBinary",
"find",
"(",
"final",
"FedoraSession",
"session",
",",
"final",
"String",
"path",
")",
"{",
"return",
"cast",
"(",
"findNode",
"(",
"session",
",",
"path",
")",
")",
";",
"}"
] | Retrieve a Datastream instance by pid and dsid
@param path jcr path to the datastream
@return datastream | [
"Retrieve",
"a",
"Datastream",
"instance",
"by",
"pid",
"and",
"dsid"
] | 7489ad5bc8fb44e2442c93eceb7d97ac54553ab6 | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-kernel-modeshape/src/main/java/org/fcrepo/kernel/modeshape/services/BinaryServiceImpl.java#L127-L130 |
102,850 | fcrepo4/fcrepo4 | fcrepo-kernel-modeshape/src/main/java/org/fcrepo/kernel/modeshape/NonRdfSourceDescriptionImpl.java | NonRdfSourceDescriptionImpl.touch | @Override
public void touch(final boolean includeMembershipResource, final Calendar createdDate, final String createdUser,
final Calendar modifiedDate, final String modifyingUser) throws RepositoryException {
super.touch(includeMembershipResource, createdDate, createdUser, modifiedDate... | java | @Override
public void touch(final boolean includeMembershipResource, final Calendar createdDate, final String createdUser,
final Calendar modifiedDate, final String modifyingUser) throws RepositoryException {
super.touch(includeMembershipResource, createdDate, createdUser, modifiedDate... | [
"@",
"Override",
"public",
"void",
"touch",
"(",
"final",
"boolean",
"includeMembershipResource",
",",
"final",
"Calendar",
"createdDate",
",",
"final",
"String",
"createdUser",
",",
"final",
"Calendar",
"modifiedDate",
",",
"final",
"String",
"modifyingUser",
")",
... | Overrides the superclass to propagate updates to certain properties to the binary if explicitly set. | [
"Overrides",
"the",
"superclass",
"to",
"propagate",
"updates",
"to",
"certain",
"properties",
"to",
"the",
"binary",
"if",
"explicitly",
"set",
"."
] | 7489ad5bc8fb44e2442c93eceb7d97ac54553ab6 | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-kernel-modeshape/src/main/java/org/fcrepo/kernel/modeshape/NonRdfSourceDescriptionImpl.java#L125-L133 |
102,851 | fcrepo4/fcrepo4 | fcrepo-kernel-modeshape/src/main/java/org/fcrepo/kernel/modeshape/services/AbstractService.java | AbstractService.exists | public boolean exists(final FedoraSession session, final String path) {
final Session jcrSession = getJcrSession(session);
try {
return jcrSession.nodeExists(path);
} catch (final RepositoryException e) {
throw new RepositoryRuntimeException(e);
}
} | java | public boolean exists(final FedoraSession session, final String path) {
final Session jcrSession = getJcrSession(session);
try {
return jcrSession.nodeExists(path);
} catch (final RepositoryException e) {
throw new RepositoryRuntimeException(e);
}
} | [
"public",
"boolean",
"exists",
"(",
"final",
"FedoraSession",
"session",
",",
"final",
"String",
"path",
")",
"{",
"final",
"Session",
"jcrSession",
"=",
"getJcrSession",
"(",
"session",
")",
";",
"try",
"{",
"return",
"jcrSession",
".",
"nodeExists",
"(",
"... | test node existence at path
@param session the session
@param path the path
@return whether T exists at the given path | [
"test",
"node",
"existence",
"at",
"path"
] | 7489ad5bc8fb44e2442c93eceb7d97ac54553ab6 | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-kernel-modeshape/src/main/java/org/fcrepo/kernel/modeshape/services/AbstractService.java#L95-L102 |
102,852 | fcrepo4/fcrepo4 | fcrepo-http-commons/src/main/java/org/fcrepo/http/commons/responses/ViewHelpers.java | ViewHelpers.getVersions | public Iterator<Node> getVersions(final Graph graph,
final Node subject) {
// Mementos should be ordered by date so use the getOrderedVersions.
return getOrderedVersions(graph, subject, CONTAINS.asResource());
} | java | public Iterator<Node> getVersions(final Graph graph,
final Node subject) {
// Mementos should be ordered by date so use the getOrderedVersions.
return getOrderedVersions(graph, subject, CONTAINS.asResource());
} | [
"public",
"Iterator",
"<",
"Node",
">",
"getVersions",
"(",
"final",
"Graph",
"graph",
",",
"final",
"Node",
"subject",
")",
"{",
"// Mementos should be ordered by date so use the getOrderedVersions.",
"return",
"getOrderedVersions",
"(",
"graph",
",",
"subject",
",",
... | Return an iterator of Triples for versions.
@param graph the graph
@param subject the subject
@return iterator | [
"Return",
"an",
"iterator",
"of",
"Triples",
"for",
"versions",
"."
] | 7489ad5bc8fb44e2442c93eceb7d97ac54553ab6 | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-http-commons/src/main/java/org/fcrepo/http/commons/responses/ViewHelpers.java#L106-L110 |
102,853 | fcrepo4/fcrepo4 | fcrepo-http-commons/src/main/java/org/fcrepo/http/commons/responses/ViewHelpers.java | ViewHelpers.getOrderedVersions | public Iterator<Node> getOrderedVersions(final Graph g, final Node subject, final Resource predicate) {
final List<Node> vs = listObjects(g, subject, predicate.asNode()).toList();
vs.sort(Comparator.comparing(v -> getVersionDate(g, v)));
return vs.iterator();
} | java | public Iterator<Node> getOrderedVersions(final Graph g, final Node subject, final Resource predicate) {
final List<Node> vs = listObjects(g, subject, predicate.asNode()).toList();
vs.sort(Comparator.comparing(v -> getVersionDate(g, v)));
return vs.iterator();
} | [
"public",
"Iterator",
"<",
"Node",
">",
"getOrderedVersions",
"(",
"final",
"Graph",
"g",
",",
"final",
"Node",
"subject",
",",
"final",
"Resource",
"predicate",
")",
"{",
"final",
"List",
"<",
"Node",
">",
"vs",
"=",
"listObjects",
"(",
"g",
",",
"subje... | Return an iterator of Triples for versions in order that
they were created.
@param g the graph
@param subject the subject
@param predicate the predicate
@return iterator | [
"Return",
"an",
"iterator",
"of",
"Triples",
"for",
"versions",
"in",
"order",
"that",
"they",
"were",
"created",
"."
] | 7489ad5bc8fb44e2442c93eceb7d97ac54553ab6 | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-http-commons/src/main/java/org/fcrepo/http/commons/responses/ViewHelpers.java#L121-L125 |
102,854 | fcrepo4/fcrepo4 | fcrepo-http-commons/src/main/java/org/fcrepo/http/commons/responses/ViewHelpers.java | ViewHelpers.getVersionLabel | public String getVersionLabel(final Graph graph, final Node subject) {
final Instant datetime = getVersionDate(graph, subject);
return MEMENTO_RFC_1123_FORMATTER.format(datetime);
} | java | public String getVersionLabel(final Graph graph, final Node subject) {
final Instant datetime = getVersionDate(graph, subject);
return MEMENTO_RFC_1123_FORMATTER.format(datetime);
} | [
"public",
"String",
"getVersionLabel",
"(",
"final",
"Graph",
"graph",
",",
"final",
"Node",
"subject",
")",
"{",
"final",
"Instant",
"datetime",
"=",
"getVersionDate",
"(",
"graph",
",",
"subject",
")",
";",
"return",
"MEMENTO_RFC_1123_FORMATTER",
".",
"format"... | Get the date time as the version label.
@param graph the graph
@param subject the subject
@return the datetime in RFC 1123 format. | [
"Get",
"the",
"date",
"time",
"as",
"the",
"version",
"label",
"."
] | 7489ad5bc8fb44e2442c93eceb7d97ac54553ab6 | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-http-commons/src/main/java/org/fcrepo/http/commons/responses/ViewHelpers.java#L155-L158 |
102,855 | fcrepo4/fcrepo4 | fcrepo-http-commons/src/main/java/org/fcrepo/http/commons/responses/ViewHelpers.java | ViewHelpers.getVersionDate | public Instant getVersionDate(final Graph graph, final Node subject) {
final String[] pathParts = subject.getURI().split("/");
return MEMENTO_LABEL_FORMATTER.parse(pathParts[pathParts.length - 1], Instant::from);
} | java | public Instant getVersionDate(final Graph graph, final Node subject) {
final String[] pathParts = subject.getURI().split("/");
return MEMENTO_LABEL_FORMATTER.parse(pathParts[pathParts.length - 1], Instant::from);
} | [
"public",
"Instant",
"getVersionDate",
"(",
"final",
"Graph",
"graph",
",",
"final",
"Node",
"subject",
")",
"{",
"final",
"String",
"[",
"]",
"pathParts",
"=",
"subject",
".",
"getURI",
"(",
")",
".",
"split",
"(",
"\"/\"",
")",
";",
"return",
"MEMENTO_... | Gets a modification date of a subject from the graph
@param graph the graph
@param subject the subject
@return the modification date if it exists | [
"Gets",
"a",
"modification",
"date",
"of",
"a",
"subject",
"from",
"the",
"graph"
] | 7489ad5bc8fb44e2442c93eceb7d97ac54553ab6 | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-http-commons/src/main/java/org/fcrepo/http/commons/responses/ViewHelpers.java#L167-L170 |
102,856 | fcrepo4/fcrepo4 | fcrepo-http-commons/src/main/java/org/fcrepo/http/commons/responses/ViewHelpers.java | ViewHelpers.getObjectTitle | public String getObjectTitle(final Graph graph, final Node sub) {
if (sub == null) {
return "";
}
final Optional<String> title = TITLE_PROPERTIES.stream().map(Property::asNode).flatMap(p -> listObjects(
graph, sub, p).toList().stream()).filter(Node::isLiteral).map(Nod... | java | public String getObjectTitle(final Graph graph, final Node sub) {
if (sub == null) {
return "";
}
final Optional<String> title = TITLE_PROPERTIES.stream().map(Property::asNode).flatMap(p -> listObjects(
graph, sub, p).toList().stream()).filter(Node::isLiteral).map(Nod... | [
"public",
"String",
"getObjectTitle",
"(",
"final",
"Graph",
"graph",
",",
"final",
"Node",
"sub",
")",
"{",
"if",
"(",
"sub",
"==",
"null",
")",
"{",
"return",
"\"\"",
";",
"}",
"final",
"Optional",
"<",
"String",
">",
"title",
"=",
"TITLE_PROPERTIES",
... | Get the canonical title of a subject from the graph
@param graph the graph
@param sub the subject
@return canonical title of the subject in the graph | [
"Get",
"the",
"canonical",
"title",
"of",
"a",
"subject",
"from",
"the",
"graph"
] | 7489ad5bc8fb44e2442c93eceb7d97ac54553ab6 | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-http-commons/src/main/java/org/fcrepo/http/commons/responses/ViewHelpers.java#L184-L192 |
102,857 | fcrepo4/fcrepo4 | fcrepo-http-commons/src/main/java/org/fcrepo/http/commons/responses/ViewHelpers.java | ViewHelpers.getObjectsAsString | public String getObjectsAsString(final Graph graph,
final Node subject, final Resource predicate, final boolean uriAsLink) {
LOGGER.trace("Getting Objects as String: s:{}, p:{}, g:{}", subject, predicate, graph);
final Iterator<Node> iterator = listObjects(graph, subject, predicate.asNode())... | java | public String getObjectsAsString(final Graph graph,
final Node subject, final Resource predicate, final boolean uriAsLink) {
LOGGER.trace("Getting Objects as String: s:{}, p:{}, g:{}", subject, predicate, graph);
final Iterator<Node> iterator = listObjects(graph, subject, predicate.asNode())... | [
"public",
"String",
"getObjectsAsString",
"(",
"final",
"Graph",
"graph",
",",
"final",
"Node",
"subject",
",",
"final",
"Resource",
"predicate",
",",
"final",
"boolean",
"uriAsLink",
")",
"{",
"LOGGER",
".",
"trace",
"(",
"\"Getting Objects as String: s:{}, p:{}, g... | Get the string version of the object that matches the given subject and
predicate
@param graph the graph
@param subject the subject
@param predicate the predicate
@param uriAsLink the boolean value of uri as link
@return string version of the object | [
"Get",
"the",
"string",
"version",
"of",
"the",
"object",
"that",
"matches",
"the",
"given",
"subject",
"and",
"predicate"
] | 7489ad5bc8fb44e2442c93eceb7d97ac54553ab6 | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-http-commons/src/main/java/org/fcrepo/http/commons/responses/ViewHelpers.java#L228-L241 |
102,858 | fcrepo4/fcrepo4 | fcrepo-http-commons/src/main/java/org/fcrepo/http/commons/responses/ViewHelpers.java | ViewHelpers.getOriginalResource | public Node getOriginalResource(final Node subject) {
if (!subject.isURI()) {
return subject;
}
final String subjectUri = subject.getURI();
final int index = subjectUri.indexOf(FCR_VERSIONS);
if (index > 0) {
return NodeFactory.createURI(subjectUri.substr... | java | public Node getOriginalResource(final Node subject) {
if (!subject.isURI()) {
return subject;
}
final String subjectUri = subject.getURI();
final int index = subjectUri.indexOf(FCR_VERSIONS);
if (index > 0) {
return NodeFactory.createURI(subjectUri.substr... | [
"public",
"Node",
"getOriginalResource",
"(",
"final",
"Node",
"subject",
")",
"{",
"if",
"(",
"!",
"subject",
".",
"isURI",
"(",
")",
")",
"{",
"return",
"subject",
";",
"}",
"final",
"String",
"subjectUri",
"=",
"subject",
".",
"getURI",
"(",
")",
";... | Returns the original resource as a URI Node if
the subject represents a memento uri; otherwise it
returns the subject parameter.
@param subject the subject
@return a URI node of the original resource. | [
"Returns",
"the",
"original",
"resource",
"as",
"a",
"URI",
"Node",
"if",
"the",
"subject",
"represents",
"a",
"memento",
"uri",
";",
"otherwise",
"it",
"returns",
"the",
"subject",
"parameter",
"."
] | 7489ad5bc8fb44e2442c93eceb7d97ac54553ab6 | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-http-commons/src/main/java/org/fcrepo/http/commons/responses/ViewHelpers.java#L250-L262 |
102,859 | fcrepo4/fcrepo4 | fcrepo-http-commons/src/main/java/org/fcrepo/http/commons/responses/ViewHelpers.java | ViewHelpers.getNumChildren | public int getNumChildren(final Graph graph, final Node subject) {
LOGGER.trace("Getting number of children: s:{}, g:{}", subject, graph);
return (int) asStream(listObjects(graph, subject, CONTAINS.asNode())).count();
} | java | public int getNumChildren(final Graph graph, final Node subject) {
LOGGER.trace("Getting number of children: s:{}, g:{}", subject, graph);
return (int) asStream(listObjects(graph, subject, CONTAINS.asNode())).count();
} | [
"public",
"int",
"getNumChildren",
"(",
"final",
"Graph",
"graph",
",",
"final",
"Node",
"subject",
")",
"{",
"LOGGER",
".",
"trace",
"(",
"\"Getting number of children: s:{}, g:{}\"",
",",
"subject",
",",
"graph",
")",
";",
"return",
"(",
"int",
")",
"asStrea... | Get the number of child resources associated with the arg 'subject' as specified by the triple found in the arg
'graph' with the predicate RdfLexicon.HAS_CHILD_COUNT.
@param graph of triples
@param subject for which child resources is sought
@return number of child resources | [
"Get",
"the",
"number",
"of",
"child",
"resources",
"associated",
"with",
"the",
"arg",
"subject",
"as",
"specified",
"by",
"the",
"triple",
"found",
"in",
"the",
"arg",
"graph",
"with",
"the",
"predicate",
"RdfLexicon",
".",
"HAS_CHILD_COUNT",
"."
] | 7489ad5bc8fb44e2442c93eceb7d97ac54553ab6 | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-http-commons/src/main/java/org/fcrepo/http/commons/responses/ViewHelpers.java#L282-L285 |
102,860 | fcrepo4/fcrepo4 | fcrepo-http-commons/src/main/java/org/fcrepo/http/commons/responses/ViewHelpers.java | ViewHelpers.getNodeBreadcrumbs | public Map<String, String> getNodeBreadcrumbs(final UriInfo uriInfo,
final Node subject) {
final String topic = subject.getURI();
LOGGER.trace("Generating breadcrumbs for subject {}", subject);
final String baseUri = uriInfo.getBaseUri().toString();
if (!topic.startsWith(ba... | java | public Map<String, String> getNodeBreadcrumbs(final UriInfo uriInfo,
final Node subject) {
final String topic = subject.getURI();
LOGGER.trace("Generating breadcrumbs for subject {}", subject);
final String baseUri = uriInfo.getBaseUri().toString();
if (!topic.startsWith(ba... | [
"public",
"Map",
"<",
"String",
",",
"String",
">",
"getNodeBreadcrumbs",
"(",
"final",
"UriInfo",
"uriInfo",
",",
"final",
"Node",
"subject",
")",
"{",
"final",
"String",
"topic",
"=",
"subject",
".",
"getURI",
"(",
")",
";",
"LOGGER",
".",
"trace",
"("... | Generate url to local name breadcrumbs for a given node's tree
@param uriInfo the uri info
@param subject the subject
@return breadcrumbs | [
"Generate",
"url",
"to",
"local",
"name",
"breadcrumbs",
"for",
"a",
"given",
"node",
"s",
"tree"
] | 7489ad5bc8fb44e2442c93eceb7d97ac54553ab6 | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-http-commons/src/main/java/org/fcrepo/http/commons/responses/ViewHelpers.java#L294-L311 |
102,861 | fcrepo4/fcrepo4 | fcrepo-http-commons/src/main/java/org/fcrepo/http/commons/responses/ViewHelpers.java | ViewHelpers.getSortedTriples | public List<Triple> getSortedTriples(final Model model, final Iterator<Triple> it) {
final List<Triple> triples = newArrayList(it);
triples.sort(new TripleOrdering(model));
return triples;
} | java | public List<Triple> getSortedTriples(final Model model, final Iterator<Triple> it) {
final List<Triple> triples = newArrayList(it);
triples.sort(new TripleOrdering(model));
return triples;
} | [
"public",
"List",
"<",
"Triple",
">",
"getSortedTriples",
"(",
"final",
"Model",
"model",
",",
"final",
"Iterator",
"<",
"Triple",
">",
"it",
")",
"{",
"final",
"List",
"<",
"Triple",
">",
"triples",
"=",
"newArrayList",
"(",
"it",
")",
";",
"triples",
... | Sort a Iterator of Triples alphabetically by its subject, predicate, and
object
@param model the model
@param it the iterator of triples
@return iterator of alphabetized triples | [
"Sort",
"a",
"Iterator",
"of",
"Triples",
"alphabetically",
"by",
"its",
"subject",
"predicate",
"and",
"object"
] | 7489ad5bc8fb44e2442c93eceb7d97ac54553ab6 | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-http-commons/src/main/java/org/fcrepo/http/commons/responses/ViewHelpers.java#L321-L325 |
102,862 | fcrepo4/fcrepo4 | fcrepo-http-commons/src/main/java/org/fcrepo/http/commons/responses/ViewHelpers.java | ViewHelpers.getPrefixPreamble | public String getPrefixPreamble(final PrefixMapping mapping) {
return mapping.getNsPrefixMap().entrySet().stream()
.map(e -> "PREFIX " + e.getKey() + ": <" + e.getValue() + ">").collect(joining("\n", "", "\n\n"));
} | java | public String getPrefixPreamble(final PrefixMapping mapping) {
return mapping.getNsPrefixMap().entrySet().stream()
.map(e -> "PREFIX " + e.getKey() + ": <" + e.getValue() + ">").collect(joining("\n", "", "\n\n"));
} | [
"public",
"String",
"getPrefixPreamble",
"(",
"final",
"PrefixMapping",
"mapping",
")",
"{",
"return",
"mapping",
".",
"getNsPrefixMap",
"(",
")",
".",
"entrySet",
"(",
")",
".",
"stream",
"(",
")",
".",
"map",
"(",
"e",
"->",
"\"PREFIX \"",
"+",
"e",
".... | Get a prefix preamble appropriate for a SPARQL-UPDATE query from a prefix
mapping object
@param mapping the prefix mapping
@return prefix preamble | [
"Get",
"a",
"prefix",
"preamble",
"appropriate",
"for",
"a",
"SPARQL",
"-",
"UPDATE",
"query",
"from",
"a",
"prefix",
"mapping",
"object"
] | 7489ad5bc8fb44e2442c93eceb7d97ac54553ab6 | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-http-commons/src/main/java/org/fcrepo/http/commons/responses/ViewHelpers.java#L357-L360 |
102,863 | fcrepo4/fcrepo4 | fcrepo-http-commons/src/main/java/org/fcrepo/http/commons/responses/ViewHelpers.java | ViewHelpers.isRdfResource | public boolean isRdfResource(final Graph graph,
final Node subject,
final String namespace,
final String resource) {
LOGGER.trace("Is RDF Resource? s:{}, ns:{}, r:{}, g:{}", subject, namespace, resource, graph);
... | java | public boolean isRdfResource(final Graph graph,
final Node subject,
final String namespace,
final String resource) {
LOGGER.trace("Is RDF Resource? s:{}, ns:{}, r:{}, g:{}", subject, namespace, resource, graph);
... | [
"public",
"boolean",
"isRdfResource",
"(",
"final",
"Graph",
"graph",
",",
"final",
"Node",
"subject",
",",
"final",
"String",
"namespace",
",",
"final",
"String",
"resource",
")",
"{",
"LOGGER",
".",
"trace",
"(",
"\"Is RDF Resource? s:{}, ns:{}, r:{}, g:{}\"",
"... | Determines whether the subject is kind of RDF resource
@param graph the graph
@param subject the subject
@param namespace the namespace
@param resource the resource
@return whether the subject is kind of RDF resource | [
"Determines",
"whether",
"the",
"subject",
"is",
"kind",
"of",
"RDF",
"resource"
] | 7489ad5bc8fb44e2442c93eceb7d97ac54553ab6 | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-http-commons/src/main/java/org/fcrepo/http/commons/responses/ViewHelpers.java#L370-L377 |
102,864 | fcrepo4/fcrepo4 | fcrepo-http-commons/src/main/java/org/fcrepo/http/commons/responses/ViewHelpers.java | ViewHelpers.isRootResource | public boolean isRootResource(final Graph graph, final Node subject) {
final String rootRes = graph.getPrefixMapping().expandPrefix(FEDORA_REPOSITORY_ROOT);
final Node root = createResource(rootRes).asNode();
return graph.contains(subject, rdfType().asNode(), root);
} | java | public boolean isRootResource(final Graph graph, final Node subject) {
final String rootRes = graph.getPrefixMapping().expandPrefix(FEDORA_REPOSITORY_ROOT);
final Node root = createResource(rootRes).asNode();
return graph.contains(subject, rdfType().asNode(), root);
} | [
"public",
"boolean",
"isRootResource",
"(",
"final",
"Graph",
"graph",
",",
"final",
"Node",
"subject",
")",
"{",
"final",
"String",
"rootRes",
"=",
"graph",
".",
"getPrefixMapping",
"(",
")",
".",
"expandPrefix",
"(",
"FEDORA_REPOSITORY_ROOT",
")",
";",
"fina... | Is the subject the repository root resource.
@param graph The graph
@param subject The current subject
@return true if has rdf:type http://fedora.info/definitions/v4/repository#RepositoryRoot | [
"Is",
"the",
"subject",
"the",
"repository",
"root",
"resource",
"."
] | 7489ad5bc8fb44e2442c93eceb7d97ac54553ab6 | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-http-commons/src/main/java/org/fcrepo/http/commons/responses/ViewHelpers.java#L386-L390 |
102,865 | fcrepo4/fcrepo4 | fcrepo-http-commons/src/main/java/org/fcrepo/http/commons/responses/ViewHelpers.java | ViewHelpers.getContentNode | public static Node getContentNode(final Node subject) {
return subject == null ? null : NodeFactory.createURI(subject.getURI().replace("/" + FCR_METADATA, ""));
} | java | public static Node getContentNode(final Node subject) {
return subject == null ? null : NodeFactory.createURI(subject.getURI().replace("/" + FCR_METADATA, ""));
} | [
"public",
"static",
"Node",
"getContentNode",
"(",
"final",
"Node",
"subject",
")",
"{",
"return",
"subject",
"==",
"null",
"?",
"null",
":",
"NodeFactory",
".",
"createURI",
"(",
"subject",
".",
"getURI",
"(",
")",
".",
"replace",
"(",
"\"/\"",
"+",
"FC... | Get the content-bearing node for the given subject
@param subject the subject
@return content-bearing node for the given subject | [
"Get",
"the",
"content",
"-",
"bearing",
"node",
"for",
"the",
"given",
"subject"
] | 7489ad5bc8fb44e2442c93eceb7d97ac54553ab6 | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-http-commons/src/main/java/org/fcrepo/http/commons/responses/ViewHelpers.java#L442-L444 |
102,866 | fcrepo4/fcrepo4 | fcrepo-http-commons/src/main/java/org/fcrepo/http/commons/responses/ViewHelpers.java | ViewHelpers.isManagedProperty | public static boolean isManagedProperty(final Node property) {
return property.isURI() && isManagedPredicate.test(createProperty(property.getURI()));
} | java | public static boolean isManagedProperty(final Node property) {
return property.isURI() && isManagedPredicate.test(createProperty(property.getURI()));
} | [
"public",
"static",
"boolean",
"isManagedProperty",
"(",
"final",
"Node",
"property",
")",
"{",
"return",
"property",
".",
"isURI",
"(",
")",
"&&",
"isManagedPredicate",
".",
"test",
"(",
"createProperty",
"(",
"property",
".",
"getURI",
"(",
")",
")",
")",
... | Test if a Predicate is managed
@param property the property
@return whether the property is managed | [
"Test",
"if",
"a",
"Predicate",
"is",
"managed"
] | 7489ad5bc8fb44e2442c93eceb7d97ac54553ab6 | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-http-commons/src/main/java/org/fcrepo/http/commons/responses/ViewHelpers.java#L470-L472 |
102,867 | fcrepo4/fcrepo4 | fcrepo-kernel-modeshape/src/main/java/org/fcrepo/kernel/modeshape/FedoraBinaryImpl.java | FedoraBinaryImpl.getBinary | private FedoraBinary getBinary(final String extUrl) {
if (wrappedBinary == null) {
wrappedBinary = getBinaryImplementation(extUrl);
}
return wrappedBinary;
} | java | private FedoraBinary getBinary(final String extUrl) {
if (wrappedBinary == null) {
wrappedBinary = getBinaryImplementation(extUrl);
}
return wrappedBinary;
} | [
"private",
"FedoraBinary",
"getBinary",
"(",
"final",
"String",
"extUrl",
")",
"{",
"if",
"(",
"wrappedBinary",
"==",
"null",
")",
"{",
"wrappedBinary",
"=",
"getBinaryImplementation",
"(",
"extUrl",
")",
";",
"}",
"return",
"wrappedBinary",
";",
"}"
] | Get the proxied binary content object wrapped by this object
@return the fedora binary | [
"Get",
"the",
"proxied",
"binary",
"content",
"object",
"wrapped",
"by",
"this",
"object"
] | 7489ad5bc8fb44e2442c93eceb7d97ac54553ab6 | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-kernel-modeshape/src/main/java/org/fcrepo/kernel/modeshape/FedoraBinaryImpl.java#L75-L80 |
102,868 | fcrepo4/fcrepo4 | fcrepo-kernel-modeshape/src/main/java/org/fcrepo/kernel/modeshape/FedoraBinaryImpl.java | FedoraBinaryImpl.getBinaryImplementation | private FedoraBinary getBinaryImplementation(final String extUrl) {
String url = extUrl;
if (url == null || url.isEmpty()) {
url = getURLInfo();
}
if (url != null) {
if (url.toLowerCase().startsWith(LOCAL_FILE_ACCESS_TYPE)) {
return new LocalFileB... | java | private FedoraBinary getBinaryImplementation(final String extUrl) {
String url = extUrl;
if (url == null || url.isEmpty()) {
url = getURLInfo();
}
if (url != null) {
if (url.toLowerCase().startsWith(LOCAL_FILE_ACCESS_TYPE)) {
return new LocalFileB... | [
"private",
"FedoraBinary",
"getBinaryImplementation",
"(",
"final",
"String",
"extUrl",
")",
"{",
"String",
"url",
"=",
"extUrl",
";",
"if",
"(",
"url",
"==",
"null",
"||",
"url",
".",
"isEmpty",
"(",
")",
")",
"{",
"url",
"=",
"getURLInfo",
"(",
")",
... | Return the proper object that can handle this type of binary
@param extUrl URL of external binary, else null if it's internal to modeshape.
@return the fedora binary, of the proper kind based on the URL or lack there of | [
"Return",
"the",
"proper",
"object",
"that",
"can",
"handle",
"this",
"type",
"of",
"binary"
] | 7489ad5bc8fb44e2442c93eceb7d97ac54553ab6 | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-kernel-modeshape/src/main/java/org/fcrepo/kernel/modeshape/FedoraBinaryImpl.java#L87-L102 |
102,869 | fcrepo4/fcrepo4 | fcrepo-kernel-modeshape/src/main/java/org/fcrepo/kernel/modeshape/FedoraBinaryImpl.java | FedoraBinaryImpl.getURLInfo | private String getURLInfo() {
try {
if (hasProperty(PROXY_FOR)) {
return getNode().getProperty(PROXY_FOR).getValue().getString();
} else if (hasProperty(REDIRECTS_TO)) {
return getNode().getProperty(REDIRECTS_TO).getValue().getString();
}
... | java | private String getURLInfo() {
try {
if (hasProperty(PROXY_FOR)) {
return getNode().getProperty(PROXY_FOR).getValue().getString();
} else if (hasProperty(REDIRECTS_TO)) {
return getNode().getProperty(REDIRECTS_TO).getValue().getString();
}
... | [
"private",
"String",
"getURLInfo",
"(",
")",
"{",
"try",
"{",
"if",
"(",
"hasProperty",
"(",
"PROXY_FOR",
")",
")",
"{",
"return",
"getNode",
"(",
")",
".",
"getProperty",
"(",
"PROXY_FOR",
")",
".",
"getValue",
"(",
")",
".",
"getString",
"(",
")",
... | Fetch the URL of the external binary
@return String containing the URL location of external binary, else null if it's an internal binary | [
"Fetch",
"the",
"URL",
"of",
"the",
"external",
"binary"
] | 7489ad5bc8fb44e2442c93eceb7d97ac54553ab6 | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-kernel-modeshape/src/main/java/org/fcrepo/kernel/modeshape/FedoraBinaryImpl.java#L108-L120 |
102,870 | fcrepo4/fcrepo4 | fcrepo-auth-webac/src/main/java/org/fcrepo/auth/webac/WebACFilter.java | WebACFilter.addURIToAuthorize | private void addURIToAuthorize(final HttpServletRequest httpRequest, final URI uri) {
@SuppressWarnings("unchecked")
Set<URI> targetURIs = (Set<URI>) httpRequest.getAttribute(URIS_TO_AUTHORIZE);
if (targetURIs == null) {
targetURIs = new HashSet<>();
httpRequest.setAttrib... | java | private void addURIToAuthorize(final HttpServletRequest httpRequest, final URI uri) {
@SuppressWarnings("unchecked")
Set<URI> targetURIs = (Set<URI>) httpRequest.getAttribute(URIS_TO_AUTHORIZE);
if (targetURIs == null) {
targetURIs = new HashSet<>();
httpRequest.setAttrib... | [
"private",
"void",
"addURIToAuthorize",
"(",
"final",
"HttpServletRequest",
"httpRequest",
",",
"final",
"URI",
"uri",
")",
"{",
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"Set",
"<",
"URI",
">",
"targetURIs",
"=",
"(",
"Set",
"<",
"URI",
">",
")",
... | Add URIs to collect permissions information for.
@param httpRequest the request.
@param uri the uri to check. | [
"Add",
"URIs",
"to",
"collect",
"permissions",
"information",
"for",
"."
] | 7489ad5bc8fb44e2442c93eceb7d97ac54553ab6 | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-auth-webac/src/main/java/org/fcrepo/auth/webac/WebACFilter.java#L169-L177 |
102,871 | fcrepo4/fcrepo4 | fcrepo-auth-webac/src/main/java/org/fcrepo/auth/webac/WebACFilter.java | WebACFilter.isPayloadIndirectOrDirect | private boolean isPayloadIndirectOrDirect(final HttpServletRequest request) {
return Collections.list(request.getHeaders("Link")).stream().map(Link::valueOf).map(Link::getUri)
.anyMatch(l -> directOrIndirect.contains(l));
} | java | private boolean isPayloadIndirectOrDirect(final HttpServletRequest request) {
return Collections.list(request.getHeaders("Link")).stream().map(Link::valueOf).map(Link::getUri)
.anyMatch(l -> directOrIndirect.contains(l));
} | [
"private",
"boolean",
"isPayloadIndirectOrDirect",
"(",
"final",
"HttpServletRequest",
"request",
")",
"{",
"return",
"Collections",
".",
"list",
"(",
"request",
".",
"getHeaders",
"(",
"\"Link\"",
")",
")",
".",
"stream",
"(",
")",
".",
"map",
"(",
"Link",
... | Is the request to create an indirect or direct container.
@param request The current request
@return whether we are acting on/creating an indirect/direct container. | [
"Is",
"the",
"request",
"to",
"create",
"an",
"indirect",
"or",
"direct",
"container",
"."
] | 7489ad5bc8fb44e2442c93eceb7d97ac54553ab6 | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-auth-webac/src/main/java/org/fcrepo/auth/webac/WebACFilter.java#L515-L518 |
102,872 | fcrepo4/fcrepo4 | fcrepo-auth-webac/src/main/java/org/fcrepo/auth/webac/WebACFilter.java | WebACFilter.isResourceIndirectOrDirect | private boolean isResourceIndirectOrDirect(final FedoraResource resource) {
return resource.getTypes().stream().anyMatch(l -> directOrIndirect.contains(l));
} | java | private boolean isResourceIndirectOrDirect(final FedoraResource resource) {
return resource.getTypes().stream().anyMatch(l -> directOrIndirect.contains(l));
} | [
"private",
"boolean",
"isResourceIndirectOrDirect",
"(",
"final",
"FedoraResource",
"resource",
")",
"{",
"return",
"resource",
".",
"getTypes",
"(",
")",
".",
"stream",
"(",
")",
".",
"anyMatch",
"(",
"l",
"->",
"directOrIndirect",
".",
"contains",
"(",
"l",
... | Is the current resource a direct or indirect container
@param request
@return | [
"Is",
"the",
"current",
"resource",
"a",
"direct",
"or",
"indirect",
"container"
] | 7489ad5bc8fb44e2442c93eceb7d97ac54553ab6 | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-auth-webac/src/main/java/org/fcrepo/auth/webac/WebACFilter.java#L526-L528 |
102,873 | fcrepo4/fcrepo4 | fcrepo-auth-webac/src/main/java/org/fcrepo/auth/webac/WebACFilter.java | WebACFilter.isAuthorizedForMembershipResource | private boolean isAuthorizedForMembershipResource(final HttpServletRequest request, final Subject currentUser)
throws IOException {
if (resourceExists(request) && request.getMethod().equalsIgnoreCase("POST")) {
// Check resource if it exists and we are POSTing to it.
if (isRe... | java | private boolean isAuthorizedForMembershipResource(final HttpServletRequest request, final Subject currentUser)
throws IOException {
if (resourceExists(request) && request.getMethod().equalsIgnoreCase("POST")) {
// Check resource if it exists and we are POSTing to it.
if (isRe... | [
"private",
"boolean",
"isAuthorizedForMembershipResource",
"(",
"final",
"HttpServletRequest",
"request",
",",
"final",
"Subject",
"currentUser",
")",
"throws",
"IOException",
"{",
"if",
"(",
"resourceExists",
"(",
"request",
")",
"&&",
"request",
".",
"getMethod",
... | Check if we are authorized to access the target of membershipRelation if required. Really this is a test for
failure. The default is true because we might not be looking at an indirect or direct container.
@param request The current request
@param currentUser The current principal
@return Whether we are creating an in... | [
"Check",
"if",
"we",
"are",
"authorized",
"to",
"access",
"the",
"target",
"of",
"membershipRelation",
"if",
"required",
".",
"Really",
"this",
"is",
"a",
"test",
"for",
"failure",
".",
"The",
"default",
"is",
"true",
"because",
"we",
"might",
"not",
"be",... | 7489ad5bc8fb44e2442c93eceb7d97ac54553ab6 | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-auth-webac/src/main/java/org/fcrepo/auth/webac/WebACFilter.java#L539-L604 |
102,874 | fcrepo4/fcrepo4 | fcrepo-auth-webac/src/main/java/org/fcrepo/auth/webac/WebACFilter.java | WebACFilter.getHasMemberFromRequest | private URI getHasMemberFromRequest(final HttpServletRequest request) throws IOException {
final String baseUri = request.getRequestURL().toString();
final RDFReader reader;
final String contentType = request.getContentType();
final Lang format = contentTypeToLang(contentType);
f... | java | private URI getHasMemberFromRequest(final HttpServletRequest request) throws IOException {
final String baseUri = request.getRequestURL().toString();
final RDFReader reader;
final String contentType = request.getContentType();
final Lang format = contentTypeToLang(contentType);
f... | [
"private",
"URI",
"getHasMemberFromRequest",
"(",
"final",
"HttpServletRequest",
"request",
")",
"throws",
"IOException",
"{",
"final",
"String",
"baseUri",
"=",
"request",
".",
"getRequestURL",
"(",
")",
".",
"toString",
"(",
")",
";",
"final",
"RDFReader",
"re... | Get the memberRelation object from the contents.
@param baseUri The current request URL
@param body The request body
@param contentType The content type.
@return The URI of the memberRelation object
@throws IOException when getting request's inputstream | [
"Get",
"the",
"memberRelation",
"object",
"from",
"the",
"contents",
"."
] | 7489ad5bc8fb44e2442c93eceb7d97ac54553ab6 | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-auth-webac/src/main/java/org/fcrepo/auth/webac/WebACFilter.java#L615-L635 |
102,875 | fcrepo4/fcrepo4 | fcrepo-auth-webac/src/main/java/org/fcrepo/auth/webac/WebACFilter.java | WebACFilter.getHasMemberFromPatch | private URI getHasMemberFromPatch(final HttpServletRequest request) throws IOException {
final String sparqlString = IOUtils.toString(request.getInputStream(), UTF_8);
final String baseURI = request.getRequestURL().toString().replace(request.getContextPath(), "").replaceAll(
request.getP... | java | private URI getHasMemberFromPatch(final HttpServletRequest request) throws IOException {
final String sparqlString = IOUtils.toString(request.getInputStream(), UTF_8);
final String baseURI = request.getRequestURL().toString().replace(request.getContextPath(), "").replaceAll(
request.getP... | [
"private",
"URI",
"getHasMemberFromPatch",
"(",
"final",
"HttpServletRequest",
"request",
")",
"throws",
"IOException",
"{",
"final",
"String",
"sparqlString",
"=",
"IOUtils",
".",
"toString",
"(",
"request",
".",
"getInputStream",
"(",
")",
",",
"UTF_8",
")",
"... | Get the membershipRelation from a PATCH request
@param request the http request
@return URI of the first ldp:membershipRelation object.
@throws IOException converting the request body to a string. | [
"Get",
"the",
"membershipRelation",
"from",
"a",
"PATCH",
"request"
] | 7489ad5bc8fb44e2442c93eceb7d97ac54553ab6 | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-auth-webac/src/main/java/org/fcrepo/auth/webac/WebACFilter.java#L644-L673 |
102,876 | fcrepo4/fcrepo4 | fcrepo-kernel-api/src/main/java/org/fcrepo/kernel/api/utils/ContentDigest.java | ContentDigest.asURI | public static URI asURI(final String algorithm, final String value) {
try {
final String scheme = DIGEST_ALGORITHM.getScheme(algorithm);
return new URI(scheme, value, null);
} catch (final URISyntaxException unlikelyException) {
LOGGER.warn("Exception creating checks... | java | public static URI asURI(final String algorithm, final String value) {
try {
final String scheme = DIGEST_ALGORITHM.getScheme(algorithm);
return new URI(scheme, value, null);
} catch (final URISyntaxException unlikelyException) {
LOGGER.warn("Exception creating checks... | [
"public",
"static",
"URI",
"asURI",
"(",
"final",
"String",
"algorithm",
",",
"final",
"String",
"value",
")",
"{",
"try",
"{",
"final",
"String",
"scheme",
"=",
"DIGEST_ALGORITHM",
".",
"getScheme",
"(",
"algorithm",
")",
";",
"return",
"new",
"URI",
"(",... | Convert a MessageDigest algorithm and checksum value to a URN
@param algorithm the message digest algorithm
@param value the checksum value
@return URI | [
"Convert",
"a",
"MessageDigest",
"algorithm",
"and",
"checksum",
"value",
"to",
"a",
"URN"
] | 7489ad5bc8fb44e2442c93eceb7d97ac54553ab6 | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-kernel-api/src/main/java/org/fcrepo/kernel/api/utils/ContentDigest.java#L97-L107 |
102,877 | fcrepo4/fcrepo4 | fcrepo-kernel-api/src/main/java/org/fcrepo/kernel/api/utils/ContentDigest.java | ContentDigest.getAlgorithm | public static String getAlgorithm(final URI digestUri) {
if (digestUri == null) {
return DEFAULT_ALGORITHM;
}
return DIGEST_ALGORITHM.fromScheme(digestUri.getScheme() + ":" +
digestUri.getSchemeSpecificPart().split(":", 2)[0]).algorithm;
} | java | public static String getAlgorithm(final URI digestUri) {
if (digestUri == null) {
return DEFAULT_ALGORITHM;
}
return DIGEST_ALGORITHM.fromScheme(digestUri.getScheme() + ":" +
digestUri.getSchemeSpecificPart().split(":", 2)[0]).algorithm;
} | [
"public",
"static",
"String",
"getAlgorithm",
"(",
"final",
"URI",
"digestUri",
")",
"{",
"if",
"(",
"digestUri",
"==",
"null",
")",
"{",
"return",
"DEFAULT_ALGORITHM",
";",
"}",
"return",
"DIGEST_ALGORITHM",
".",
"fromScheme",
"(",
"digestUri",
".",
"getSchem... | Given a digest URI, get the corresponding MessageDigest algorithm
@param digestUri the digest uri
@return MessageDigest algorithm | [
"Given",
"a",
"digest",
"URI",
"get",
"the",
"corresponding",
"MessageDigest",
"algorithm"
] | 7489ad5bc8fb44e2442c93eceb7d97ac54553ab6 | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-kernel-api/src/main/java/org/fcrepo/kernel/api/utils/ContentDigest.java#L124-L130 |
102,878 | fcrepo4/fcrepo4 | fcrepo-kernel-modeshape/src/main/java/org/fcrepo/kernel/modeshape/rdf/impl/LdpIsMemberOfRdfContext.java | LdpIsMemberOfRdfContext.getMemberResource | private Node getMemberResource(final FedoraResource parent) throws RepositoryException {
final Node membershipResource;
if (parent.hasProperty(LDP_MEMBER_RESOURCE)) {
final Property memberResource = getJcrNode(parent).getProperty(LDP_MEMBER_RESOURCE);
if (REFERENCE_TYPES.contai... | java | private Node getMemberResource(final FedoraResource parent) throws RepositoryException {
final Node membershipResource;
if (parent.hasProperty(LDP_MEMBER_RESOURCE)) {
final Property memberResource = getJcrNode(parent).getProperty(LDP_MEMBER_RESOURCE);
if (REFERENCE_TYPES.contai... | [
"private",
"Node",
"getMemberResource",
"(",
"final",
"FedoraResource",
"parent",
")",
"throws",
"RepositoryException",
"{",
"final",
"Node",
"membershipResource",
";",
"if",
"(",
"parent",
".",
"hasProperty",
"(",
"LDP_MEMBER_RESOURCE",
")",
")",
"{",
"final",
"P... | Get the membership resource relation asserted by the container
@param parent resource with relations
@return Node of member
@throws RepositoryException on error | [
"Get",
"the",
"membership",
"resource",
"relation",
"asserted",
"by",
"the",
"container"
] | 7489ad5bc8fb44e2442c93eceb7d97ac54553ab6 | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-kernel-modeshape/src/main/java/org/fcrepo/kernel/modeshape/rdf/impl/LdpIsMemberOfRdfContext.java#L126-L142 |
102,879 | fcrepo4/fcrepo4 | fcrepo-kernel-modeshape/src/main/java/org/fcrepo/kernel/modeshape/rdf/converters/ValueConverter.java | ValueConverter.nodeForValue | public static javax.jcr.Node nodeForValue(final Session session, final Value v) throws RepositoryException {
if (v.getType() == PATH) {
return session.getNode(v.getString());
} else if (v.getType() == REFERENCE || v.getType() == WEAKREFERENCE) {
return session.getNodeByIdentifier... | java | public static javax.jcr.Node nodeForValue(final Session session, final Value v) throws RepositoryException {
if (v.getType() == PATH) {
return session.getNode(v.getString());
} else if (v.getType() == REFERENCE || v.getType() == WEAKREFERENCE) {
return session.getNodeByIdentifier... | [
"public",
"static",
"javax",
".",
"jcr",
".",
"Node",
"nodeForValue",
"(",
"final",
"Session",
"session",
",",
"final",
"Value",
"v",
")",
"throws",
"RepositoryException",
"{",
"if",
"(",
"v",
".",
"getType",
"(",
")",
"==",
"PATH",
")",
"{",
"return",
... | Get the node that a property value refers to.
@param session Session to use to load the node.
@param v Value that refers to a node.
@return the JCR node
@throws RepositoryException When there is an error accessing the node.
@throws RepositoryRuntimeException When the value type is not PATH, REFERENCE or WEAKREFERENCE. | [
"Get",
"the",
"node",
"that",
"a",
"property",
"value",
"refers",
"to",
"."
] | 7489ad5bc8fb44e2442c93eceb7d97ac54553ab6 | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-kernel-modeshape/src/main/java/org/fcrepo/kernel/modeshape/rdf/converters/ValueConverter.java#L179-L188 |
102,880 | fcrepo4/fcrepo4 | fcrepo-auth-webac/src/main/java/org/fcrepo/auth/webac/WebACRolesProvider.java | WebACRolesProvider.getRoles | public Map<String, Collection<String>> getRoles(final Node node) {
return getAgentRoles(nodeConverter.convert(node));
} | java | public Map<String, Collection<String>> getRoles(final Node node) {
return getAgentRoles(nodeConverter.convert(node));
} | [
"public",
"Map",
"<",
"String",
",",
"Collection",
"<",
"String",
">",
">",
"getRoles",
"(",
"final",
"Node",
"node",
")",
"{",
"return",
"getAgentRoles",
"(",
"nodeConverter",
".",
"convert",
"(",
"node",
")",
")",
";",
"}"
] | Get the roles assigned to this Node.
@param node the subject Node
@return a set of roles for each principal | [
"Get",
"the",
"roles",
"assigned",
"to",
"this",
"Node",
"."
] | 7489ad5bc8fb44e2442c93eceb7d97ac54553ab6 | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-auth-webac/src/main/java/org/fcrepo/auth/webac/WebACRolesProvider.java#L110-L112 |
102,881 | fcrepo4/fcrepo4 | fcrepo-auth-webac/src/main/java/org/fcrepo/auth/webac/WebACRolesProvider.java | WebACRolesProvider.getAgentMembers | private static Stream<String> getAgentMembers(final IdentifierConverter<Resource, FedoraResource> translator,
final FedoraResource resource, final String hashPortion) {
//resolve list of triples, accounting for hash-uris.
final List<Triple> triples = re... | java | private static Stream<String> getAgentMembers(final IdentifierConverter<Resource, FedoraResource> translator,
final FedoraResource resource, final String hashPortion) {
//resolve list of triples, accounting for hash-uris.
final List<Triple> triples = re... | [
"private",
"static",
"Stream",
"<",
"String",
">",
"getAgentMembers",
"(",
"final",
"IdentifierConverter",
"<",
"Resource",
",",
"FedoraResource",
">",
"translator",
",",
"final",
"FedoraResource",
"resource",
",",
"final",
"String",
"hashPortion",
")",
"{",
"//re... | Given a FedoraResource, return a list of agents. | [
"Given",
"a",
"FedoraResource",
"return",
"a",
"list",
"of",
"agents",
"."
] | 7489ad5bc8fb44e2442c93eceb7d97ac54553ab6 | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-auth-webac/src/main/java/org/fcrepo/auth/webac/WebACRolesProvider.java#L258-L276 |
102,882 | fcrepo4/fcrepo4 | fcrepo-auth-webac/src/main/java/org/fcrepo/auth/webac/WebACRolesProvider.java | WebACRolesProvider.nodeToStringStream | private static Stream<String> nodeToStringStream(final org.apache.jena.graph.Node object) {
if (object.isURI()) {
return of(object.getURI());
} else if (object.isLiteral()) {
return of(object.getLiteralValue().toString());
} else {
return empty();
}
... | java | private static Stream<String> nodeToStringStream(final org.apache.jena.graph.Node object) {
if (object.isURI()) {
return of(object.getURI());
} else if (object.isLiteral()) {
return of(object.getLiteralValue().toString());
} else {
return empty();
}
... | [
"private",
"static",
"Stream",
"<",
"String",
">",
"nodeToStringStream",
"(",
"final",
"org",
".",
"apache",
".",
"jena",
".",
"graph",
".",
"Node",
"object",
")",
"{",
"if",
"(",
"object",
".",
"isURI",
"(",
")",
")",
"{",
"return",
"of",
"(",
"obje... | Map a Jena Node to a Stream of Strings. Any non-URI, non-Literals map to an empty Stream,
making this suitable to use with flatMap. | [
"Map",
"a",
"Jena",
"Node",
"to",
"a",
"Stream",
"of",
"Strings",
".",
"Any",
"non",
"-",
"URI",
"non",
"-",
"Literals",
"map",
"to",
"an",
"empty",
"Stream",
"making",
"this",
"suitable",
"to",
"use",
"with",
"flatMap",
"."
] | 7489ad5bc8fb44e2442c93eceb7d97ac54553ab6 | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-auth-webac/src/main/java/org/fcrepo/auth/webac/WebACRolesProvider.java#L290-L298 |
102,883 | fcrepo4/fcrepo4 | fcrepo-auth-webac/src/main/java/org/fcrepo/auth/webac/WebACRolesProvider.java | WebACRolesProvider.getEffectiveAcl | static Optional<ACLHandle> getEffectiveAcl(final FedoraResource resource, final boolean ancestorAcl,
final SessionFactory sessionFactory) {
try {
final FedoraResource aclResource = resource.getAcl();
if (aclResource != null) {
... | java | static Optional<ACLHandle> getEffectiveAcl(final FedoraResource resource, final boolean ancestorAcl,
final SessionFactory sessionFactory) {
try {
final FedoraResource aclResource = resource.getAcl();
if (aclResource != null) {
... | [
"static",
"Optional",
"<",
"ACLHandle",
">",
"getEffectiveAcl",
"(",
"final",
"FedoraResource",
"resource",
",",
"final",
"boolean",
"ancestorAcl",
",",
"final",
"SessionFactory",
"sessionFactory",
")",
"{",
"try",
"{",
"final",
"FedoraResource",
"aclResource",
"=",... | Recursively find the effective ACL as a URI along with the FedoraResource that points to it.
This way, if the effective ACL is pointed to from a parent resource, the child will inherit
any permissions that correspond to access to that parent. This ACL resource may or may not exist,
and it may be external to the fedora ... | [
"Recursively",
"find",
"the",
"effective",
"ACL",
"as",
"a",
"URI",
"along",
"with",
"the",
"FedoraResource",
"that",
"points",
"to",
"it",
".",
"This",
"way",
"if",
"the",
"effective",
"ACL",
"is",
"pointed",
"to",
"from",
"a",
"parent",
"resource",
"the"... | 7489ad5bc8fb44e2442c93eceb7d97ac54553ab6 | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-auth-webac/src/main/java/org/fcrepo/auth/webac/WebACRolesProvider.java#L395-L421 |
102,884 | fcrepo4/fcrepo4 | fcrepo-http-api/src/main/java/org/fcrepo/http/api/repository/FedoraRepositoryRestore.java | FedoraRepositoryRestore.runRestore | @POST
public Response runRestore(final InputStream bodyStream) throws IOException {
if (null == bodyStream) {
throw new WebApplicationException(serverError().entity(
"Request body must not be null").build());
}
final String body = IOUtils.toString(bodyStream... | java | @POST
public Response runRestore(final InputStream bodyStream) throws IOException {
if (null == bodyStream) {
throw new WebApplicationException(serverError().entity(
"Request body must not be null").build());
}
final String body = IOUtils.toString(bodyStream... | [
"@",
"POST",
"public",
"Response",
"runRestore",
"(",
"final",
"InputStream",
"bodyStream",
")",
"throws",
"IOException",
"{",
"if",
"(",
"null",
"==",
"bodyStream",
")",
"{",
"throw",
"new",
"WebApplicationException",
"(",
"serverError",
"(",
")",
".",
"entit... | This method runs a repository restore.
@param bodyStream the body stream
@return response
@throws IOException if IO exception occurred | [
"This",
"method",
"runs",
"a",
"repository",
"restore",
"."
] | 7489ad5bc8fb44e2442c93eceb7d97ac54553ab6 | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-http-api/src/main/java/org/fcrepo/http/api/repository/FedoraRepositoryRestore.java#L71-L104 |
102,885 | fcrepo4/fcrepo4 | fcrepo-http-commons/src/main/java/org/fcrepo/http/commons/domain/SinglePrefer.java | SinglePrefer.getReturn | public PreferTag getReturn() {
return preferTags().stream()
.filter(x -> x.getTag().equals("return"))
.findFirst().orElse(emptyTag());
} | java | public PreferTag getReturn() {
return preferTags().stream()
.filter(x -> x.getTag().equals("return"))
.findFirst().orElse(emptyTag());
} | [
"public",
"PreferTag",
"getReturn",
"(",
")",
"{",
"return",
"preferTags",
"(",
")",
".",
"stream",
"(",
")",
".",
"filter",
"(",
"x",
"->",
"x",
".",
"getTag",
"(",
")",
".",
"equals",
"(",
"\"return\"",
")",
")",
".",
"findFirst",
"(",
")",
".",
... | Get the return tag, or a blank default, if none exists.
@return return tag, or a blank default, if none exists | [
"Get",
"the",
"return",
"tag",
"or",
"a",
"blank",
"default",
"if",
"none",
"exists",
"."
] | 7489ad5bc8fb44e2442c93eceb7d97ac54553ab6 | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-http-commons/src/main/java/org/fcrepo/http/commons/domain/SinglePrefer.java#L72-L76 |
102,886 | fcrepo4/fcrepo4 | fcrepo-http-commons/src/main/java/org/fcrepo/http/commons/domain/PreferTag.java | PreferTag.addResponseHeaders | public void addResponseHeaders(final HttpServletResponse servletResponse) {
final String receivedParam = ofNullable(params.get("received")).orElse("");
final List<String> includes = asList(ofNullable(params.get("include")).orElse(" ").split(" "));
final List<String> omits = asList(ofNullable(pa... | java | public void addResponseHeaders(final HttpServletResponse servletResponse) {
final String receivedParam = ofNullable(params.get("received")).orElse("");
final List<String> includes = asList(ofNullable(params.get("include")).orElse(" ").split(" "));
final List<String> omits = asList(ofNullable(pa... | [
"public",
"void",
"addResponseHeaders",
"(",
"final",
"HttpServletResponse",
"servletResponse",
")",
"{",
"final",
"String",
"receivedParam",
"=",
"ofNullable",
"(",
"params",
".",
"get",
"(",
"\"received\"",
")",
")",
".",
"orElse",
"(",
"\"\"",
")",
";",
"fi... | Add appropriate response headers to indicate that the incoming preferences were acknowledged
@param servletResponse the servlet response | [
"Add",
"appropriate",
"response",
"headers",
"to",
"indicate",
"that",
"the",
"incoming",
"preferences",
"were",
"acknowledged"
] | 7489ad5bc8fb44e2442c93eceb7d97ac54553ab6 | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-http-commons/src/main/java/org/fcrepo/http/commons/domain/PreferTag.java#L137-L173 |
102,887 | fcrepo4/fcrepo4 | fcrepo-jms/src/main/java/org/fcrepo/jms/AbstractJMSPublisher.java | AbstractJMSPublisher.publishJCREvent | @Subscribe
public void publishJCREvent(final FedoraEvent fedoraEvent) throws JMSException {
LOGGER.debug("Received an event from the internal bus.");
final Message tm =
eventFactory.getMessage(fedoraEvent, jmsSession);
LOGGER.debug("Transformed the event to a JMS message.");
... | java | @Subscribe
public void publishJCREvent(final FedoraEvent fedoraEvent) throws JMSException {
LOGGER.debug("Received an event from the internal bus.");
final Message tm =
eventFactory.getMessage(fedoraEvent, jmsSession);
LOGGER.debug("Transformed the event to a JMS message.");
... | [
"@",
"Subscribe",
"public",
"void",
"publishJCREvent",
"(",
"final",
"FedoraEvent",
"fedoraEvent",
")",
"throws",
"JMSException",
"{",
"LOGGER",
".",
"debug",
"(",
"\"Received an event from the internal bus.\"",
")",
";",
"final",
"Message",
"tm",
"=",
"eventFactory",... | When an EventBus mesage is received, map it to our JMS
message payload and push it onto the queue.
@param fedoraEvent the fedora event
@throws JMSException if JMS exception occurred | [
"When",
"an",
"EventBus",
"mesage",
"is",
"received",
"map",
"it",
"to",
"our",
"JMS",
"message",
"payload",
"and",
"push",
"it",
"onto",
"the",
"queue",
"."
] | 7489ad5bc8fb44e2442c93eceb7d97ac54553ab6 | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-jms/src/main/java/org/fcrepo/jms/AbstractJMSPublisher.java#L75-L84 |
102,888 | fcrepo4/fcrepo4 | fcrepo-jms/src/main/java/org/fcrepo/jms/AbstractJMSPublisher.java | AbstractJMSPublisher.acquireConnections | @PostConstruct
public void acquireConnections() throws JMSException {
LOGGER.debug("Initializing: {}", this.getClass().getCanonicalName());
connection = connectionFactory.createConnection();
connection.start();
jmsSession = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
... | java | @PostConstruct
public void acquireConnections() throws JMSException {
LOGGER.debug("Initializing: {}", this.getClass().getCanonicalName());
connection = connectionFactory.createConnection();
connection.start();
jmsSession = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
... | [
"@",
"PostConstruct",
"public",
"void",
"acquireConnections",
"(",
")",
"throws",
"JMSException",
"{",
"LOGGER",
".",
"debug",
"(",
"\"Initializing: {}\"",
",",
"this",
".",
"getClass",
"(",
")",
".",
"getCanonicalName",
"(",
")",
")",
";",
"connection",
"=",
... | Connect to JCR Repostory and JMS queue
@throws JMSException if JMS Exception occurred | [
"Connect",
"to",
"JCR",
"Repostory",
"and",
"JMS",
"queue"
] | 7489ad5bc8fb44e2442c93eceb7d97ac54553ab6 | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-jms/src/main/java/org/fcrepo/jms/AbstractJMSPublisher.java#L91-L100 |
102,889 | fcrepo4/fcrepo4 | fcrepo-jms/src/main/java/org/fcrepo/jms/AbstractJMSPublisher.java | AbstractJMSPublisher.releaseConnections | @PreDestroy
public void releaseConnections() throws JMSException {
LOGGER.debug("Tearing down: {}", this.getClass().getCanonicalName());
producer.close();
jmsSession.close();
connection.close();
eventBus.unregister(this);
} | java | @PreDestroy
public void releaseConnections() throws JMSException {
LOGGER.debug("Tearing down: {}", this.getClass().getCanonicalName());
producer.close();
jmsSession.close();
connection.close();
eventBus.unregister(this);
} | [
"@",
"PreDestroy",
"public",
"void",
"releaseConnections",
"(",
")",
"throws",
"JMSException",
"{",
"LOGGER",
".",
"debug",
"(",
"\"Tearing down: {}\"",
",",
"this",
".",
"getClass",
"(",
")",
".",
"getCanonicalName",
"(",
")",
")",
";",
"producer",
".",
"cl... | Close external connections
@throws JMSException if JMS exception occurred | [
"Close",
"external",
"connections"
] | 7489ad5bc8fb44e2442c93eceb7d97ac54553ab6 | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-jms/src/main/java/org/fcrepo/jms/AbstractJMSPublisher.java#L107-L115 |
102,890 | fcrepo4/fcrepo4 | fcrepo-kernel-modeshape/src/main/java/org/fcrepo/kernel/modeshape/services/RepositoryServiceImpl.java | RepositoryServiceImpl.getRepositorySize | @Override
public Long getRepositorySize() {
try {
LOGGER.debug("Calculating repository size from index");
final Repository repo = getJcrRepository(repository);
// Differentiating between the local getRepositorySize and
// ServiceHelpers
return Se... | java | @Override
public Long getRepositorySize() {
try {
LOGGER.debug("Calculating repository size from index");
final Repository repo = getJcrRepository(repository);
// Differentiating between the local getRepositorySize and
// ServiceHelpers
return Se... | [
"@",
"Override",
"public",
"Long",
"getRepositorySize",
"(",
")",
"{",
"try",
"{",
"LOGGER",
".",
"debug",
"(",
"\"Calculating repository size from index\"",
")",
";",
"final",
"Repository",
"repo",
"=",
"getJcrRepository",
"(",
"repository",
")",
";",
"// Differe... | Calculate the total size of all the binary properties in the repository
@return size in bytes | [
"Calculate",
"the",
"total",
"size",
"of",
"all",
"the",
"binary",
"properties",
"in",
"the",
"repository"
] | 7489ad5bc8fb44e2442c93eceb7d97ac54553ab6 | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-kernel-modeshape/src/main/java/org/fcrepo/kernel/modeshape/services/RepositoryServiceImpl.java#L63-L76 |
102,891 | fcrepo4/fcrepo4 | fcrepo-http-api/src/main/java/org/fcrepo/http/api/FedoraBaseResource.java | FedoraBaseResource.getResourceFromPath | @VisibleForTesting
public FedoraResource getResourceFromPath(final String externalPath) {
final Resource resource = translator().toDomain(externalPath);
final FedoraResource fedoraResource = translator().convert(resource);
if (fedoraResource instanceof Tombstone) {
final String ... | java | @VisibleForTesting
public FedoraResource getResourceFromPath(final String externalPath) {
final Resource resource = translator().toDomain(externalPath);
final FedoraResource fedoraResource = translator().convert(resource);
if (fedoraResource instanceof Tombstone) {
final String ... | [
"@",
"VisibleForTesting",
"public",
"FedoraResource",
"getResourceFromPath",
"(",
"final",
"String",
"externalPath",
")",
"{",
"final",
"Resource",
"resource",
"=",
"translator",
"(",
")",
".",
"toDomain",
"(",
"externalPath",
")",
";",
"final",
"FedoraResource",
... | Get the FedoraResource for the resource at the external path
@param externalPath the external path
@return the fedora resource at the external path | [
"Get",
"the",
"FedoraResource",
"for",
"the",
"resource",
"at",
"the",
"external",
"path"
] | 7489ad5bc8fb44e2442c93eceb7d97ac54553ab6 | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-http-api/src/main/java/org/fcrepo/http/api/FedoraBaseResource.java#L91-L102 |
102,892 | fcrepo4/fcrepo4 | fcrepo-http-api/src/main/java/org/fcrepo/http/api/FedoraBaseResource.java | FedoraBaseResource.setUpJMSInfo | protected void setUpJMSInfo(final UriInfo uriInfo, final HttpHeaders headers) {
try {
String baseURL = getBaseUrlProperty(uriInfo);
if (baseURL.length() == 0) {
baseURL = uriInfo.getBaseUri().toString();
}
LOGGER.debug("setting baseURL = " + baseUR... | java | protected void setUpJMSInfo(final UriInfo uriInfo, final HttpHeaders headers) {
try {
String baseURL = getBaseUrlProperty(uriInfo);
if (baseURL.length() == 0) {
baseURL = uriInfo.getBaseUri().toString();
}
LOGGER.debug("setting baseURL = " + baseUR... | [
"protected",
"void",
"setUpJMSInfo",
"(",
"final",
"UriInfo",
"uriInfo",
",",
"final",
"HttpHeaders",
"headers",
")",
"{",
"try",
"{",
"String",
"baseURL",
"=",
"getBaseUrlProperty",
"(",
"uriInfo",
")",
";",
"if",
"(",
"baseURL",
".",
"length",
"(",
")",
... | Set the baseURL for JMS events.
@param uriInfo the uri info
@param headers HTTP headers | [
"Set",
"the",
"baseURL",
"for",
"JMS",
"events",
"."
] | 7489ad5bc8fb44e2442c93eceb7d97ac54553ab6 | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-http-api/src/main/java/org/fcrepo/http/api/FedoraBaseResource.java#L109-L123 |
102,893 | fcrepo4/fcrepo4 | fcrepo-kernel-api/src/main/java/org/fcrepo/kernel/api/rdf/DefaultRdfStream.java | DefaultRdfStream.fromModel | public static RdfStream fromModel(final Node node, final Model model) {
return new DefaultRdfStream(node,
stream(spliteratorUnknownSize(model.listStatements(), IMMUTABLE), false).map(Statement::asTriple));
} | java | public static RdfStream fromModel(final Node node, final Model model) {
return new DefaultRdfStream(node,
stream(spliteratorUnknownSize(model.listStatements(), IMMUTABLE), false).map(Statement::asTriple));
} | [
"public",
"static",
"RdfStream",
"fromModel",
"(",
"final",
"Node",
"node",
",",
"final",
"Model",
"model",
")",
"{",
"return",
"new",
"DefaultRdfStream",
"(",
"node",
",",
"stream",
"(",
"spliteratorUnknownSize",
"(",
"model",
".",
"listStatements",
"(",
")",... | Create an RdfStream from an existing Model.
@param node The subject node
@param model An input Model
@return a new RdfStream object | [
"Create",
"an",
"RdfStream",
"from",
"an",
"existing",
"Model",
"."
] | 7489ad5bc8fb44e2442c93eceb7d97ac54553ab6 | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-kernel-api/src/main/java/org/fcrepo/kernel/api/rdf/DefaultRdfStream.java#L73-L76 |
102,894 | fcrepo4/fcrepo4 | fcrepo-kernel-modeshape/src/main/java/org/fcrepo/kernel/modeshape/identifiers/NodeResourceConverter.java | NodeResourceConverter.nodeToResource | public static Converter<Node, Resource> nodeToResource(final Converter<Resource, FedoraResource> c) {
return nodeConverter.andThen(c.reverse());
} | java | public static Converter<Node, Resource> nodeToResource(final Converter<Resource, FedoraResource> c) {
return nodeConverter.andThen(c.reverse());
} | [
"public",
"static",
"Converter",
"<",
"Node",
",",
"Resource",
">",
"nodeToResource",
"(",
"final",
"Converter",
"<",
"Resource",
",",
"FedoraResource",
">",
"c",
")",
"{",
"return",
"nodeConverter",
".",
"andThen",
"(",
"c",
".",
"reverse",
"(",
")",
")",... | Get a converter that can transform a Node to a Resource
@param c the given node
@return the converter that can transform a node to resource | [
"Get",
"a",
"converter",
"that",
"can",
"transform",
"a",
"Node",
"to",
"a",
"Resource"
] | 7489ad5bc8fb44e2442c93eceb7d97ac54553ab6 | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-kernel-modeshape/src/main/java/org/fcrepo/kernel/modeshape/identifiers/NodeResourceConverter.java#L46-L48 |
102,895 | fcrepo4/fcrepo4 | fcrepo-kernel-api/src/main/java/org/fcrepo/kernel/api/utils/AutoReloadingConfiguration.java | AutoReloadingConfiguration.monitorForChanges | private void monitorForChanges() {
if (monitorRunning) {
return;
}
final Path path;
try {
path = Paths.get(configPath);
} catch (final Exception e) {
LOGGER.warn("Cannot monitor configuration {}, disabling monitoring; {}", configPath, e.getMes... | java | private void monitorForChanges() {
if (monitorRunning) {
return;
}
final Path path;
try {
path = Paths.get(configPath);
} catch (final Exception e) {
LOGGER.warn("Cannot monitor configuration {}, disabling monitoring; {}", configPath, e.getMes... | [
"private",
"void",
"monitorForChanges",
"(",
")",
"{",
"if",
"(",
"monitorRunning",
")",
"{",
"return",
";",
"}",
"final",
"Path",
"path",
";",
"try",
"{",
"path",
"=",
"Paths",
".",
"get",
"(",
"configPath",
")",
";",
"}",
"catch",
"(",
"final",
"Ex... | Starts up monitoring of the configuration for changes. | [
"Starts",
"up",
"monitoring",
"of",
"the",
"configuration",
"for",
"changes",
"."
] | 7489ad5bc8fb44e2442c93eceb7d97ac54553ab6 | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-kernel-api/src/main/java/org/fcrepo/kernel/api/utils/AutoReloadingConfiguration.java#L85-L165 |
102,896 | fcrepo4/fcrepo4 | fcrepo-kernel-api/src/main/java/org/fcrepo/kernel/api/utils/AutoReloadingConfiguration.java | AutoReloadingConfiguration.setConfigPath | public void setConfigPath(final String configPath) {
// Resolve classpath references without spring's help
if (configPath != null && configPath.startsWith("classpath:")) {
final String relativePath = configPath.substring(10);
this.configPath = this.getClass().getResource(relative... | java | public void setConfigPath(final String configPath) {
// Resolve classpath references without spring's help
if (configPath != null && configPath.startsWith("classpath:")) {
final String relativePath = configPath.substring(10);
this.configPath = this.getClass().getResource(relative... | [
"public",
"void",
"setConfigPath",
"(",
"final",
"String",
"configPath",
")",
"{",
"// Resolve classpath references without spring's help",
"if",
"(",
"configPath",
"!=",
"null",
"&&",
"configPath",
".",
"startsWith",
"(",
"\"classpath:\"",
")",
")",
"{",
"final",
"... | Set the file path for the configuration
@param configPath file path for configuration | [
"Set",
"the",
"file",
"path",
"for",
"the",
"configuration"
] | 7489ad5bc8fb44e2442c93eceb7d97ac54553ab6 | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-kernel-api/src/main/java/org/fcrepo/kernel/api/utils/AutoReloadingConfiguration.java#L172-L180 |
102,897 | fcrepo4/fcrepo4 | fcrepo-kernel-api/src/main/java/org/fcrepo/kernel/api/services/functions/ConfigurableHierarchicalSupplier.java | ConfigurableHierarchicalSupplier.get | @Override
public String get() {
final String s = randomUUID().toString();
final String id;
if (count > 0 && length > 0) {
final StringJoiner joiner = new StringJoiner("/", "", "/" + s);
IntStream.rangeClosed(0, count - 1)
.forEach(x -> joiner.add(s.subs... | java | @Override
public String get() {
final String s = randomUUID().toString();
final String id;
if (count > 0 && length > 0) {
final StringJoiner joiner = new StringJoiner("/", "", "/" + s);
IntStream.rangeClosed(0, count - 1)
.forEach(x -> joiner.add(s.subs... | [
"@",
"Override",
"public",
"String",
"get",
"(",
")",
"{",
"final",
"String",
"s",
"=",
"randomUUID",
"(",
")",
".",
"toString",
"(",
")",
";",
"final",
"String",
"id",
";",
"if",
"(",
"count",
">",
"0",
"&&",
"length",
">",
"0",
")",
"{",
"final... | Mint a unique identifier as a UUID
@return uuid | [
"Mint",
"a",
"unique",
"identifier",
"as",
"a",
"UUID"
] | 7489ad5bc8fb44e2442c93eceb7d97ac54553ab6 | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-kernel-api/src/main/java/org/fcrepo/kernel/api/services/functions/ConfigurableHierarchicalSupplier.java#L66-L82 |
102,898 | fcrepo4/fcrepo4 | fcrepo-kernel-modeshape/src/main/java/org/fcrepo/kernel/modeshape/services/NodeServiceImpl.java | NodeServiceImpl.find | @Override
public FedoraResource find(final FedoraSession session, final String path) {
final Session jcrSession = getJcrSession(session);
try {
return new FedoraResourceImpl(jcrSession.getNode(path));
} catch (final RepositoryException e) {
throw new RepositoryRuntime... | java | @Override
public FedoraResource find(final FedoraSession session, final String path) {
final Session jcrSession = getJcrSession(session);
try {
return new FedoraResourceImpl(jcrSession.getNode(path));
} catch (final RepositoryException e) {
throw new RepositoryRuntime... | [
"@",
"Override",
"public",
"FedoraResource",
"find",
"(",
"final",
"FedoraSession",
"session",
",",
"final",
"String",
"path",
")",
"{",
"final",
"Session",
"jcrSession",
"=",
"getJcrSession",
"(",
"session",
")",
";",
"try",
"{",
"return",
"new",
"FedoraResou... | Retrieve an existing Fedora resource at the given path
@param session a JCR session
@param path a JCR path
@return Fedora resource at the given path | [
"Retrieve",
"an",
"existing",
"Fedora",
"resource",
"at",
"the",
"given",
"path"
] | 7489ad5bc8fb44e2442c93eceb7d97ac54553ab6 | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-kernel-modeshape/src/main/java/org/fcrepo/kernel/modeshape/services/NodeServiceImpl.java#L75-L83 |
102,899 | fcrepo4/fcrepo4 | fcrepo-kernel-modeshape/src/main/java/org/fcrepo/kernel/modeshape/services/NodeServiceImpl.java | NodeServiceImpl.copyObject | @Override
public void copyObject(final FedoraSession session, final String source, final String destination) {
final Session jcrSession = getJcrSession(session);
try {
jcrSession.getWorkspace().copy(source, destination);
touchLdpMembershipResource(getJcrNode(find(session, des... | java | @Override
public void copyObject(final FedoraSession session, final String source, final String destination) {
final Session jcrSession = getJcrSession(session);
try {
jcrSession.getWorkspace().copy(source, destination);
touchLdpMembershipResource(getJcrNode(find(session, des... | [
"@",
"Override",
"public",
"void",
"copyObject",
"(",
"final",
"FedoraSession",
"session",
",",
"final",
"String",
"source",
",",
"final",
"String",
"destination",
")",
"{",
"final",
"Session",
"jcrSession",
"=",
"getJcrSession",
"(",
"session",
")",
";",
"try... | Copy an existing object from the source path to the destination path
@param session a JCR session
@param source the source path
@param destination the destination path | [
"Copy",
"an",
"existing",
"object",
"from",
"the",
"source",
"path",
"to",
"the",
"destination",
"path"
] | 7489ad5bc8fb44e2442c93eceb7d97ac54553ab6 | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-kernel-modeshape/src/main/java/org/fcrepo/kernel/modeshape/services/NodeServiceImpl.java#L92-L101 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.