Return a File object representing the pathname to our persistence file, if any. @return the file
()
| 325 | * @return the file |
| 326 | */ |
| 327 | protected File file() { |
| 328 | if (pathname == null || pathname.isEmpty()) { |
| 329 | return null; |
| 330 | } |
| 331 | File file = new File(pathname); |
| 332 | if (!file.isAbsolute()) { |
| 333 | Context context = getContext(); |
| 334 | ServletContext servletContext = context.getServletContext(); |
| 335 | File tempdir = (File) servletContext.getAttribute(ServletContext.TEMPDIR); |
| 336 | if (tempdir != null) { |
| 337 | file = new File(tempdir, pathname); |
| 338 | } |
| 339 | } |
| 340 | return file; |
| 341 | } |
| 342 | } |
no test coverage detected