Changeset 2937


Ignore:
Timestamp:
Nov 20, 2006, 8:33:37 AM (16 years ago)
Author:
Nicklas Nordborg
Message:

Fixed a windows bug with path separators

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/core/net/sf/basedb/core/File.java

    r2913 r2937  
    893893  private static final String separator = java.io.File.separator;
    894894  private static final SimpleDateFormat SUBDIR_FORMAT =
    895     new SimpleDateFormat("yyyy-ww"+separator+"F-ss");
     895    new SimpleDateFormat("yyyy-ww"+separator+"dd-ss");
    896896
    897897  /**
     
    945945    String absPath = file.getAbsolutePath();
    946946    String rootPath = Application.getUserFilesDirectory().getAbsolutePath();
    947     String relPath = absPath.replace(rootPath, "");
     947    String relPath = absPath.replaceFirst(rootPath, "");
    948948    if (relPath.startsWith(separator))
    949949    {
    950950      relPath = relPath.substring(separator.length());
    951951    }
    952     relPath = relPath.replaceAll(separator, "/");
     952    relPath = relPath.replace(separator, "/");
    953953    return relPath;
    954954  }
     
    962962  {
    963963    // Convert forward slash to file system separator
    964     relativePath = relativePath.replaceAll("/", separator);
     964    relativePath = relativePath.replace("/", separator);
    965965    return new java.io.File(Application.getUserFilesDirectory(), relativePath);
    966966  }
Note: See TracChangeset for help on using the changeset viewer.