[sarasvati] r1285 committed - Improve handling for filenames which contain dots before the .wf.xml. ...

0 views
Skip to first unread message

sara...@googlecode.com

unread,
Feb 26, 2013, 10:55:44 PM2/26/13
to sarasvati-...@googlegroups.com
Revision: 1285
Author: plorenz
Date: Tue Feb 26 19:55:25 2013
Log: Improve handling for filenames which contain dots before
the .wf.xml. Contributed by Michael Bildner.
http://code.google.com/p/sarasvati/source/detail?r=1285

Modified:

/java/trunk/sarasvati-editor/src/main/java/com/googlecode/sarasvati/editor/GraphEditor.java

=======================================
---
/java/trunk/sarasvati-editor/src/main/java/com/googlecode/sarasvati/editor/GraphEditor.java
Wed Sep 21 18:55:04 2011
+++
/java/trunk/sarasvati-editor/src/main/java/com/googlecode/sarasvati/editor/GraphEditor.java
Tue Feb 26 19:55:25 2013
@@ -607,11 +607,17 @@
private File getEditorPropertiesFile (final File graphFile)
{
String name = graphFile.getName();
- final int firstDot = name.indexOf( '.' );
-
- if ( firstDot > 0 )
+ if ( name.endsWith( ".wf.xml" ) )
{
- name = name.substring( 0, firstDot );
+ name = name.substring( 0, name.length() - 7 );
+ }
+ else
+ {
+ final int firstDot = name.indexOf( '.' );
+ if ( firstDot > 0 )
+ {
+ name = name.substring( 0, firstDot );
+ }
}

return new File( graphFile.getParentFile(), name + ".editor.xml" );
@@ -636,11 +642,9 @@

String name = outputFile.getName();

- final int firstDot = name.indexOf( '.' );
-
- if ( firstDot > 0 )
+ if ( name.endsWith( ".wf.xml" ) )
{
- name = name.substring( 0, firstDot );
+ name = name.substring( 0, name.length() - 7 );
saveFile = outputFile;
}
else
Reply all
Reply to author
Forward
0 new messages