diff options
author | Tobias Schwarz | 2013-01-22 16:16:01 +0000 |
---|---|---|
committer | Tobias Schwarz | 2013-01-22 16:16:01 +0000 |
commit | d4f39ecc4aaf48c50dd72ab71d162caef4a69152 (patch) | |
tree | 190ac570148b132b83fb83eb6619cc5961300901 /target_explorer/plugins/org.eclipse.tcf.te.runtime.persistence/src/org/eclipse/tcf | |
parent | fa420c8f0168019f5a8d368cd7d5522c1e95980c (diff) | |
download | org.eclipse.tcf-d4f39ecc4aaf48c50dd72ab71d162caef4a69152.tar.gz org.eclipse.tcf-d4f39ecc4aaf48c50dd72ab71d162caef4a69152.tar.xz org.eclipse.tcf-d4f39ecc4aaf48c50dd72ab71d162caef4a69152.zip |
TE: fix file name generation for read and delete
Diffstat (limited to 'target_explorer/plugins/org.eclipse.tcf.te.runtime.persistence/src/org/eclipse/tcf')
-rw-r--r-- | target_explorer/plugins/org.eclipse.tcf.te.runtime.persistence/src/org/eclipse/tcf/te/runtime/persistence/delegates/GsonMapPersistenceDelegate.java | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.runtime.persistence/src/org/eclipse/tcf/te/runtime/persistence/delegates/GsonMapPersistenceDelegate.java b/target_explorer/plugins/org.eclipse.tcf.te.runtime.persistence/src/org/eclipse/tcf/te/runtime/persistence/delegates/GsonMapPersistenceDelegate.java index 737183b5b..01c6d5ae5 100644 --- a/target_explorer/plugins/org.eclipse.tcf.te.runtime.persistence/src/org/eclipse/tcf/te/runtime/persistence/delegates/GsonMapPersistenceDelegate.java +++ b/target_explorer/plugins/org.eclipse.tcf.te.runtime.persistence/src/org/eclipse/tcf/te/runtime/persistence/delegates/GsonMapPersistenceDelegate.java @@ -179,6 +179,13 @@ public class GsonMapPersistenceDelegate extends ExecutableExtension implements I throw new IOException("URI must denote an absolute file path."); //$NON-NLS-1$ } + if (!file.exists()) { + IPath path = new Path(file.getCanonicalPath()); + if (path.getFileExtension() == null) { + file = path.addFileExtension(getDefaultFileExtension()).toFile(); + } + } + Reader reader = null; try { reader = new InputStreamReader(new FileInputStream(file), "UTF-8"); //$NON-NLS-1$ @@ -230,6 +237,13 @@ public class GsonMapPersistenceDelegate extends ExecutableExtension implements I throw new IOException("URI must denote an absolute file path."); //$NON-NLS-1$ } + if (!file.exists()) { + IPath path = new Path(file.getCanonicalPath()); + if (path.getFileExtension() == null) { + file = path.addFileExtension(getDefaultFileExtension()).toFile(); + } + } + // If the file defaultFileExtension is no set, default to "properties" IPath path = new Path(file.getCanonicalPath()); if (path.getFileExtension() == null) { |