85 |
85 |
86 Vector roots = new Vector(); |
86 Vector roots = new Vector(); |
87 for (int index = 0; index < drives.length; index++) |
87 for (int index = 0; index < drives.length; index++) |
88 { |
88 { |
89 String toAdd = drives[index].iRootPath.replace('\\', '/'); |
89 String toAdd = drives[index].iRootPath.replace('\\', '/'); |
90 if (FileAccessHelper.accessAllowed(toAdd, |
90 roots.addElement(toAdd); |
91 FileConstants.INTENT_READ, getProtectionDomain(), false)) |
|
92 { |
|
93 roots.addElement(toAdd); |
|
94 } |
|
95 } |
91 } |
96 return roots; |
92 return roots; |
97 } |
93 } |
98 |
94 |
99 public static String getDefaultRoot() |
95 public static String getDefaultRoot() |
220 Vector roots = new Vector(); |
216 Vector roots = new Vector(); |
221 |
217 |
222 for (int index = 0; index < drives.length; index++) |
218 for (int index = 0; index < drives.length; index++) |
223 { |
219 { |
224 String toAdd = drives[index].iRootPath.replace('\\', '/'); |
220 String toAdd = drives[index].iRootPath.replace('\\', '/'); |
225 if (FileAccessHelper.accessAllowed(toAdd, |
221 roots.addElement(drives[index]); |
226 FileConstants.INTENT_READ, getProtectionDomain(), false)) |
|
227 { |
|
228 roots.addElement(drives[index]); |
|
229 } |
|
230 } |
222 } |
231 |
223 |
232 Vector rootNames = new Vector(); |
224 Vector rootNames = new Vector(); |
233 for (int index = 0; index < roots.size(); index++) |
225 for (int index = 0; index < roots.size(); index++) |
234 { |
226 { |
325 retValue = null; |
317 retValue = null; |
326 } |
318 } |
327 return FileConnectionTexts.get(propKey); |
319 return FileConnectionTexts.get(propKey); |
328 } |
320 } |
329 |
321 |
330 public static Vector getForbiddenPaths() |
|
331 { |
|
332 String pathString = _getForbiddenPaths(); |
|
333 String[] pathArray = Tokenizer.split(pathString, "*"); |
|
334 Vector paths = new Vector(); |
|
335 |
|
336 for (int index = 0; index < pathArray.length - 1; index++) |
|
337 { |
|
338 String toAdd = pathArray[index]; |
|
339 toAdd = toAdd.replace('\\', '/'); |
|
340 paths.addElement(toAdd); |
|
341 } |
|
342 return paths; |
|
343 } |
|
344 |
|
345 public static Vector getRestrictedPaths() |
|
346 { |
|
347 String pathString = _getRestrictedPaths(); |
|
348 String[] pathArray = Tokenizer.split(pathString, "*"); |
|
349 Vector paths = new Vector(); |
|
350 |
|
351 for (int index = 0; index < pathArray.length - 1; index++) |
|
352 { |
|
353 String toAdd = pathArray[index]; |
|
354 toAdd = toAdd.replace('\\', '/'); |
|
355 paths.addElement(toAdd); |
|
356 } |
|
357 return paths; |
|
358 } |
|
359 |
|
360 public static String getAppPrivateDir() |
322 public static String getAppPrivateDir() |
361 { |
323 { |
362 String appPrivateDir = iAppInfo.getRootPath(); |
324 String appPrivateDir = iAppInfo.getRootPath(); |
363 appPrivateDir = appPrivateDir.replace('\\', '/'); |
325 appPrivateDir = appPrivateDir.replace('\\', '/'); |
364 appPrivateDir += "scratch/"; |
326 appPrivateDir += "scratch/"; |
365 return appPrivateDir; |
327 return appPrivateDir; |
366 } |
328 } |
367 |
329 |
|
330 public static String getMidpRoot() |
|
331 { |
|
332 String midpRoot = _getMidpRoot(); |
|
333 |
|
334 midpRoot = midpRoot.replace('\\', '/'); |
|
335 return midpRoot; |
|
336 } |
|
337 |
368 private static native String _getMemoryCardDrivePath(); |
338 private static native String _getMemoryCardDrivePath(); |
369 |
339 |
370 private static native String _getTemporaryDrivePath(); |
340 private static native String _getTemporaryDrivePath(); |
371 |
341 |
372 private static native String _getRomDrivePath(); |
342 private static native String _getRomDrivePath(); |
373 |
343 |
374 private static native String _getDefaultRootPath(); |
344 private static native String _getDefaultRootPath(); |
375 |
345 |
376 private static native String _getPathOfProperty(int value, boolean addRoot); |
346 private static native String _getPathOfProperty(int value, boolean addRoot); |
377 |
347 |
378 private static native String _getForbiddenPaths(); |
348 private static native String _getMidpRoot(); |
379 |
|
380 private static native String _getRestrictedPaths(); |
|
381 } |
349 } |