java.fedora.common.Constants Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of fcrepo-client Show documentation
Show all versions of fcrepo-client Show documentation
The Fedora Client is a Java Library that allows API access to a Fedora Repository. The client is typically one part of a full Fedora installation.
The newest version!
/*
* -----------------------------------------------------------------------------
*
* License and Copyright: The contents of this file are subject to the
* Apache License, Version 2.0 (the "License"); you may not use
* this file except in compliance with the License. You may obtain a copy of
* the License at
* http://www.fedora-commons.org/licenses.
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
* the specific language governing rights and limitations under the License.
*
* The entire file consists of original code.
* Copyright © 2008 Fedora Commons, Inc.
*
Copyright © 2002-2007 The Rector and Visitors of the University of
* Virginia and Cornell University
* All rights reserved.
*
* -----------------------------------------------------------------------------
*/
package fedora.common;
import fedora.common.policy.*;
import fedora.common.rdf.*;
/**
* Constants of general utility.
*
*/
public interface Constants {
public static final FedoraNamespace FEDORA = new FedoraNamespace();
/**
* The base directory of the Fedora installation.
*
* This is normally determined by the FEDORA_HOME environment variable,
* but if defined, the fedora.home
system property will be
* used instead.
*/
public static final String FEDORA_HOME = FedoraHome.getValue();
/** The PID of the Fedora system definition object. */
public static final PID FEDORA_SYSTEM_DEF_PID = PID.getInstance("fedora-system:def");
public static final String FEDORA_SYSTEM_DEF_URI = FEDORA_SYSTEM_DEF_PID.toURI();
/* rdf namespaces */
public static final DublinCoreNamespace DC = new DublinCoreNamespace();
public static final FedoraModelNamespace MODEL = new FedoraModelNamespace();
public static final FedoraRelsExtNamespace RELS_EXT = new FedoraRelsExtNamespace();
public static final FedoraViewNamespace VIEW = new FedoraViewNamespace();
public static final RecoveryNamespace RECOVERY = new RecoveryNamespace();
public static final RDFSyntaxNamespace RDF = new RDFSyntaxNamespace();
public static final TucanaNamespace TUCANA = new TucanaNamespace();
public static final XSDNamespace XSD = new XSDNamespace();
/* policy namespaces */
public static final SubjectNamespace SUBJECT = SubjectNamespace.getInstance();
public static final ActionNamespace ACTION = ActionNamespace.getInstance();
public static final ResourceNamespace RESOURCE = ResourceNamespace.getInstance();
public static final ObjectNamespace OBJECT = ObjectNamespace.getInstance();
public static final DatastreamNamespace DATASTREAM = DatastreamNamespace.getInstance();
public static final DisseminatorNamespace DISSEMINATOR = DisseminatorNamespace.getInstance();
public static final BDefNamespace BDEF = BDefNamespace.getInstance();
public static final BMechNamespace BMECH = BMechNamespace.getInstance();
public static final EnvironmentNamespace ENVIRONMENT = EnvironmentNamespace.getInstance();
public static final HttpRequestNamespace HTTP_REQUEST = HttpRequestNamespace.getInstance();
static class FedoraHome {
/**
* Determines the value of the FEDORA_HOME constant based on the
* fedora.home
system property (checked first) or the
* FEDORA_HOME
environment variable.
*
* @returns the value, or null
if undefined in both
* places.
*/
public static final String getValue() {
if (System.getProperty("fedora.home") != null) {
return System.getProperty("fedora.home");
} else {
return System.getenv("FEDORA_HOME");
}
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy