private FcrepoClient getClient() { if (fcrepoClient == null) { return client().credentials(authUsername, authPassword).authScope(authHost) .throwExceptionOnFailure().build(); } return fcrepoClient; } }
/** * contentType getter * * @return the mime-type of response */ public String getContentType() { if (contentType == null && headers != null) { contentType = getHeaderValue(CONTENT_TYPE); } return contentType; }
@Override public GetBuilder addLinkHeader(final FcrepoLink linkHeader) { return (GetBuilder) super.addLinkHeader(linkHeader); } }
/** * Retrieve the resource location from a HEAD request. */ private URI getMetadataUri(final String url) throws FcrepoOperationFailedException { final FcrepoResponse headResponse = fcrepoClient.head(URI.create(url)).perform(); if (headResponse.getLocation() != null) { return headResponse.getLocation(); } else { return URI.create(url); } }
/** * Make a POST request to create a new resource within an LDP container. * * @param url the URL of the resource to which to POST * @return a post request builder object */ public PostBuilder post(final URI url) { return new PostBuilder(url, this); }
/** * Build a FcrepoClient * * @return a client builder */ public static FcrepoClientBuilder client() { return new FcrepoClientBuilder(); }
@Override public OriginalMementoBuilder addLinkHeader(final FcrepoLink linkHeader) { return (OriginalMementoBuilder) super.addLinkHeader(linkHeader); } }
@Override public PatchBuilder addLinkHeader(final FcrepoLink linkHeader) { return (PatchBuilder) super.addLinkHeader(linkHeader); } }
/** * Add a body to this request from a stream, with application/octet-stream as its content type * * @param stream InputStream of the content to be sent to the server * @return this builder */ protected BodyRequestBuilder body(final InputStream stream) { return body(stream, null); }
/** * Make a POST request to create a new memento (LDPRm) within an LDPCv using the given memento-datetime and the * request body. * * @param url the URL of the LDPCv in which to create the LDPRm. * @param mementoDatetime the RFC1123 formatted memento datetime. * @return a memento creation request builder object */ public HistoricMementoBuilder createMemento(final URI url, final String mementoDatetime) { return new HistoricMementoBuilder(url, this, mementoDatetime); }
/** * Make a HEAD request to retrieve resource headers. * * @param url the URL of the resource to make the HEAD request on. * @return a HEAD request builder object */ public HeadBuilder head(final URI url) { return new HeadBuilder(url, this); }
private final Box sized(JComponent jc, Dimension min, Dimension pref, Dimension max) { return sized(jc, min, pref, max, false); }
public void actionPerformed(ActionEvent evt) { fmt_chosen = null; dispose(); } });
/** * Retrieve the REL portion of the link * * @return the "rel" portion of a Link header */ public String getRel() { return getParam(META_REL); }
/** * Simple parser to convert a link header containing a single link into an FcrepoLink object. * * @param link link header value. * @return FcrepoLink representing the link */ public static FcrepoLink valueOf(final String link) { return new FcrepoLink(link); }
/** * Make a PATCH request to modify the triples associated with a resource with SPARQL-Update. * * @param url the URL of the resource to which to PATCH * @return a patch request builder object */ public PatchBuilder patch(final URI url) { return new PatchBuilder(url, this); }
/** * Make a POST request to create a new memento (LDPRm) within an LDPCv of the current version of a resource. * * @param url the URL of the LDPCv in which to create the LDPRm. * @return a memento creation request builder object */ public OriginalMementoBuilder createMemento(final URI url) { return new OriginalMementoBuilder(url, this); }
@Override public MoveBuilder addHeader(final String name, final String value) { return (MoveBuilder) super.addHeader(name, value); } }
/** * Provide a SHA-1 checksum for the body of this request. * * @param digest sha-1 checksum to provide as the digest for the request body * @return this builder */ protected BodyRequestBuilder digestSha1(final String digest) { return digest(digest, "sha"); }
/** * Make a OPTIONS request to output information about the supported HTTP methods, etc. * * @param url the URL of the resource to make the OPTIONS request on. * @return a OPTIONS request builder object */ public OptionsBuilder options(final URI url) { return new OptionsBuilder(url, this); }