()
| 142 | /// |
| 143 | /// The parent directory path. |
| 144 | public String getParent() { |
| 145 | |
| 146 | if ("file://".equals(path) || "file:///".equals(path) || path.length() == 0) { |
| 147 | return null; |
| 148 | } |
| 149 | |
| 150 | String out = path; |
| 151 | if (out.endsWith("/")) { |
| 152 | out = out.substring(0, out.length() - 1); |
| 153 | if (out.endsWith("/")) { |
| 154 | return null; |
| 155 | } |
| 156 | } |
| 157 | return out.substring(0, out.lastIndexOf('/')); |
| 158 | |
| 159 | |
| 160 | } |
| 161 | |
| 162 | /// Returns the file object for the parent directory. |
| 163 | public File getParentFile() { |