| 58 | String acceleratorPath = null; |
| 59 | boolean needsPassword = false; |
| 60 | protected String getAcceleratorPath(String documentPath) { |
| 61 | try { |
| 62 | String accelerator = new File(documentPath). |
| 63 | getCanonicalFile(). |
| 64 | getPath(). |
| 65 | replace(File.separatorChar, '%'). |
| 66 | replace('\\', '%'). |
| 67 | replace('/', '%'). |
| 68 | replace(':', '%') + ".accel"; |
| 69 | String tmpdir = System.getProperty("java.io.tmpdir"); |
| 70 | return new File(tmpdir, accelerator).getCanonicalFile().getPath(); |
| 71 | } catch (Exception e) { |
| 72 | return null; |
| 73 | } |
| 74 | } |
| 75 | protected boolean acceleratorValid(String documentPath, String acceleratorPath) { |
| 76 | try { |
| 77 | long documentModified = new File(documentPath).lastModified(); |