diff options
author | Denis Lila <dlila@redhat.com> | 2011-03-15 11:11:07 -0400 |
---|---|---|
committer | Denis Lila <dlila@redhat.com> | 2011-03-15 11:11:07 -0400 |
commit | e3baa1c7d05508cb1b9e522f0157a0cf62491b42 (patch) | |
tree | 54fb6340fd61a22d469207668c3d1f80edec3355 /netx/net/sourceforge/jnlp/services/XPersistenceService.java | |
parent | 20e7ad77b70507d5f53ef945147751a7e41e86fe (diff) |
Handling error code returning functions.
Diffstat (limited to 'netx/net/sourceforge/jnlp/services/XPersistenceService.java')
-rw-r--r-- | netx/net/sourceforge/jnlp/services/XPersistenceService.java | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/netx/net/sourceforge/jnlp/services/XPersistenceService.java b/netx/net/sourceforge/jnlp/services/XPersistenceService.java index be98d12..4da8336 100644 --- a/netx/net/sourceforge/jnlp/services/XPersistenceService.java +++ b/netx/net/sourceforge/jnlp/services/XPersistenceService.java @@ -93,7 +93,8 @@ class XPersistenceService implements PersistenceService { checkLocation(location); File file = toCacheFile(location); - file.getParentFile().mkdirs(); + FileUtils.createParentDir(file, "Persistence store for " + + location.toString()); if (file.exists()) throw new IOException("File already exists."); @@ -110,7 +111,7 @@ class XPersistenceService implements PersistenceService { public void delete(URL location) throws MalformedURLException, IOException { checkLocation(location); - toCacheFile(location).delete(); + FileUtils.deleteWithErrMesg(toCacheFile(location), " tocache"); } /** @@ -124,7 +125,8 @@ class XPersistenceService implements PersistenceService { if (!file.exists()) throw new FileNotFoundException("Persistence store for " + location.toString() + " is not found."); - file.getParentFile().mkdirs(); + FileUtils.createParentDir(file, "Persistence store for " + + location.toString()); return (FileContents) ServiceUtil.createPrivilegedProxy(FileContents.class, new XFileContents(file)); } |