commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ozeigerm...@apache.org
Subject cvs commit: jakarta-commons-sandbox/transaction/src/java/org/apache/commons/transaction/file FileResourceManager.java
Date Mon, 26 Jul 2004 11:23:54 GMT
ozeigermann    2004/07/26 04:23:54

  Modified:    transaction/src/java/org/apache/commons/transaction/file
                        FileResourceManager.java
  Log:
  Improved central string code a bit
  
  Revision  Changes    Path
  1.5       +17 -8     jakarta-commons-sandbox/transaction/src/java/org/apache/commons/transaction/file/FileResourceManager.java
  
  Index: FileResourceManager.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/transaction/src/java/org/apache/commons/transaction/file/FileResourceManager.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- FileResourceManager.java	23 Jun 2004 06:55:51 -0000	1.4
  +++ FileResourceManager.java	26 Jul 2004 11:23:54 -0000	1.5
  @@ -947,16 +947,25 @@
       }
   
       protected String getMainPath(Object path) {
  -        return storeDir + assureLeadingSlash(path);
  +        StringBuffer buf = new StringBuffer(storeDir.length() + path.toString().length()
+ 5);
  +        buf.append(storeDir).append(assureLeadingSlash(path));
  +        return buf.toString();
       }
   
       protected String getChangePath(Object txId, Object path) {
  -
  -        return workDir + "/" + txId + "/" + WORK_CHANGE_DIR + assureLeadingSlash(path);
  +        StringBuffer buf = new StringBuffer(txId.toString().length() + path.toString().length()
  +                + WORK_CHANGE_DIR.length() + workDir.length() + 5);
  +        buf.append(workDir).append('/').append(txId.toString()).append('/').append(WORK_CHANGE_DIR).append(
  +                assureLeadingSlash(path));
  +        return buf.toString();
       }
   
       protected String getDeletePath(Object txId, Object path) {
  -        return workDir + "/" + txId + "/" + WORK_DELETE_DIR + assureLeadingSlash(path);
  +        StringBuffer buf = new StringBuffer(txId.toString().length() + path.toString().length()
  +                + WORK_DELETE_DIR.length() + workDir.length() + 5);
  +        buf.append(workDir).append('/').append(txId.toString()).append('/').append(WORK_DELETE_DIR).append(
  +                assureLeadingSlash(path));
  +        return buf.toString();
       }
   
       protected boolean undoScheduledDelete(Object txId, Object resourceId) throws ResourceManagerException
{
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message