Skip to content

Commit

Permalink
Added more Javadocs
Browse files Browse the repository at this point in the history
  • Loading branch information
ajs6f committed Feb 4, 2013
1 parent 880fc61 commit ecfe133
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 3 deletions.
34 changes: 31 additions & 3 deletions src/main/java/org/fcrepo/modeshape/AbstractResource.java
Expand Up @@ -28,22 +28,49 @@
import freemarker.template.Template;
import freemarker.template.TemplateException;

/**
* Abstract superclass for Fedora JAX-RS Resources, providing convenience fields
* and methods.
*
* @author ajs6f
*
*/
public abstract class AbstractResource extends Constants {

final private Logger logger = LoggerFactory
.getLogger(AbstractResource.class);


/**
* Jackson JSON mapper. Should eventually be replaced by the use of proper
* JAX-RS Providers.
*/
@Inject
protected ObjectMapper mapper;

/**
* The JCR repository at the heart of Fedora.
*/
@Inject
protected Repository repo;

/**
* A resource that can mint new Fedora PIDs.
*/
@Inject
protected PidMinter pidMinter;

static protected Workspace ws;

/**
* A Freemarker Configuration for use in generating XML responses. Should
* eventually be replaced by the use of proper JAX-RS Providers.
*/
final static protected Configuration freemarker = new Configuration();

/**
* A convenience object provided by ModeShape for acting against the JCR
* repository.
*/
final static protected JcrTools jcrTools = new JcrTools(true);

@PostConstruct
Expand All @@ -67,7 +94,8 @@ protected synchronized Response deleteResource(final String path)
if (session.nodeExists(path)) {

if (session.hasPermission(path, "remove")) {
//ws.getLockManager().lock(path, true, true, Long.MAX_VALUE, "");
// ws.getLockManager().lock(path, true, true, Long.MAX_VALUE,
// "");
session.getNode(path).remove();
session.save();
session.logout();
Expand Down
6 changes: 6 additions & 0 deletions src/main/java/org/fcrepo/modeshape/Constants.java
Expand Up @@ -2,6 +2,12 @@

import javax.ws.rs.core.Response;

/**
* Convenience class for constructs useful to many JAX-RS methods.
*
* @author ajs6f
*
*/
public abstract class Constants {

protected static final Response four01 = Response.status(404).entity("401")
Expand Down

0 comments on commit ecfe133

Please sign in to comment.