I am creating a Maven web application which stores many policy files in policy
folder. My source folder layout looks like :
I tried to set the folder path as policyLocation as shown below:
try {
// InputStream aa =
// Accesscontrol.class.getClass().getResource(aa);
String AbsolutePath = new File("/").getAbsolutePath();
String policyLocation = (new File("."))
.getCanonicalPath() + File.separator + "policy";
System.setProperty(
FileBasedPolicyFinderModule.POLICY_DIR_PROPERTY,
policyLocation);
} catch (IOException e) {
System.err.println("Can not locate policy repository");
}
But this is returning my Eclipse folder. Is there anyway I can get the policy folder that is not inside Resource folder (cause it can't be included inside Resource) in java web application?