-
Notifications
You must be signed in to change notification settings - Fork 130
/
AbstractResource.java
63 lines (50 loc) · 1.46 KB
/
AbstractResource.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/*
* The contents of this file are subject to the license and copyright
* detailed in the LICENSE and NOTICE files at the root of the source
* tree.
*/
package org.fcrepo.http.commons;
import java.util.function.Supplier;
import javax.inject.Inject;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.HttpHeaders;
import javax.ws.rs.core.UriInfo;
import org.fcrepo.config.FedoraPropsConfig;
import org.fcrepo.kernel.api.models.ResourceFactory;
import org.fcrepo.kernel.api.services.VersionService;
import org.fcrepo.kernel.api.services.functions.ConfigurableHierarchicalSupplier;
import org.fcrepo.kernel.api.services.functions.UniqueValueSupplier;
import org.jvnet.hk2.annotations.Optional;
/**
* Superclass for Fedora JAX-RS Resources, providing convenience fields and methods.
*
* @author ajs6f
*/
public class AbstractResource {
@Inject
protected FedoraPropsConfig fedoraPropsConfig;
/**
* Useful for constructing URLs
*/
@Context
protected UriInfo uriInfo;
/**
* For getting user agent
*/
@Context
protected HttpHeaders headers;
@Inject
protected ResourceFactory resourceFactory;
/**
* The version service
*/
@Inject
protected VersionService versionService;
/**
* A resource that can mint new Fedora PIDs.
*/
@Inject
@Optional
protected Supplier<String> pidMinter;
protected UniqueValueSupplier defaultPidMinter = new ConfigurableHierarchicalSupplier();
}