|
Lines 31-36
public class DirBundleFile extends BundleFile {
Link Here
|
| 31 |
private static final String PROPERTY_STRICT_BUNDLE_ENTRY_PATH = "osgi.strictBundleEntryPath";//$NON-NLS-1$ |
31 |
private static final String PROPERTY_STRICT_BUNDLE_ENTRY_PATH = "osgi.strictBundleEntryPath";//$NON-NLS-1$ |
| 32 |
private static final String PROPERTY_STRICT_BUNDLE_ENTRY_PATH_DEFAULT_VALUE = "false";//$NON-NLS-1$ |
32 |
private static final String PROPERTY_STRICT_BUNDLE_ENTRY_PATH_DEFAULT_VALUE = "false";//$NON-NLS-1$ |
| 33 |
|
33 |
|
|
|
34 |
private final String baseFileCanonicalPath; |
| 34 |
private final boolean enableStrictBundleEntryPath; |
35 |
private final boolean enableStrictBundleEntryPath; |
| 35 |
|
36 |
|
| 36 |
/** |
37 |
/** |
|
Lines 43-54
public class DirBundleFile extends BundleFile {
Link Here
|
| 43 |
if (!BundleFile.secureAction.exists(basefile) || !BundleFile.secureAction.isDirectory(basefile)) { |
44 |
if (!BundleFile.secureAction.exists(basefile) || !BundleFile.secureAction.isDirectory(basefile)) { |
| 44 |
throw new IOException(NLS.bind(AdaptorMsg.ADAPTOR_DIRECTORY_EXCEPTION, basefile)); |
45 |
throw new IOException(NLS.bind(AdaptorMsg.ADAPTOR_DIRECTORY_EXCEPTION, basefile)); |
| 45 |
} |
46 |
} |
|
|
47 |
this.baseFileCanonicalPath = BundleFile.secureAction.getCanonicalPath(basefile); |
| 46 |
this.enableStrictBundleEntryPath = Boolean.parseBoolean(BundleFile.secureAction.getProperty(PROPERTY_STRICT_BUNDLE_ENTRY_PATH, PROPERTY_STRICT_BUNDLE_ENTRY_PATH_DEFAULT_VALUE)); |
48 |
this.enableStrictBundleEntryPath = Boolean.parseBoolean(BundleFile.secureAction.getProperty(PROPERTY_STRICT_BUNDLE_ENTRY_PATH, PROPERTY_STRICT_BUNDLE_ENTRY_PATH_DEFAULT_VALUE)); |
| 47 |
} |
49 |
} |
| 48 |
|
50 |
|
| 49 |
public File getFile(String path, boolean nativeCode) { |
51 |
public File getFile(String path, boolean nativeCode) { |
| 50 |
final boolean checkInBundle = path != null && path.indexOf(POINTER_UPPER_DIRECTORY) >= 0; |
52 |
final boolean checkInBundle = path != null && path.indexOf(POINTER_UPPER_DIRECTORY) >= 0; |
| 51 |
File file = new File(this.basefile, path); |
53 |
File file = new File(this.baseFileCanonicalPath, path); |
| 52 |
if (!BundleFile.secureAction.exists(file)) { |
54 |
if (!BundleFile.secureAction.exists(file)) { |
| 53 |
return null; |
55 |
return null; |
| 54 |
} |
56 |
} |