import org.apache.commons.logging.Log;
import org.argeo.cms.CmsException;
-import org.argeo.cms.KernelHeader;
+import org.argeo.cms.auth.AuthConstants;
/** Package utilities */
class KernelUtils implements KernelConstants {
.getAbsoluteFile();
}
+ static String getOsgiInstancePath(String relativePath) {
+ try {
+ if (relativePath == null)
+ return getOsgiInstanceDir().getCanonicalPath();
+ else
+ return new File(getOsgiInstanceDir(), relativePath)
+ .getCanonicalPath();
+ } catch (IOException e) {
+ throw new CmsException("Cannot get instance path for "
+ + relativePath, e);
+ }
+ }
+
static File getOsgiConfigurationFile(String relativePath) {
try {
return new File(new URI(Activator.getBundleContext().getProperty(
Subject subject = new Subject();
LoginContext lc;
try {
- lc = new LoginContext(KernelHeader.LOGIN_CONTEXT_ANONYMOUS, subject);
+ lc = new LoginContext(AuthConstants.LOGIN_CONTEXT_ANONYMOUS,
+ subject);
lc.login();
return subject;
} catch (LoginException e) {