dirkv       01/07/25 11:02:46

  Modified:    src/stores/slidestore/reference FileContentStore.java
  Log:
  fix: current directory for default ="."
  use namespace logger during init
  extra check when using reset
  
  Revision  Changes    Path
  1.10      +12 -11    
jakarta-slide/src/stores/slidestore/reference/FileContentStore.java
  
  Index: FileContentStore.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-slide/src/stores/slidestore/reference/FileContentStore.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- FileContentStore.java     2001/07/21 13:10:01     1.9
  +++ FileContentStore.java     2001/07/25 18:02:46     1.10
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-slide/src/stores/slidestore/reference/FileContentStore.java,v 1.9 
2001/07/21 13:10:01 dirkv Exp $
  - * $Revision: 1.9 $
  - * $Date: 2001/07/21 13:10:01 $
  + * $Header: 
/home/cvs/jakarta-slide/src/stores/slidestore/reference/FileContentStore.java,v 1.10 
2001/07/25 18:02:46 dirkv Exp $
  + * $Revision: 1.10 $
  + * $Date: 2001/07/25 18:02:46 $
    *
    * ====================================================================
    *
  @@ -77,7 +77,7 @@
    * Filesystem implementation of ContentStore.
    *
    * @author <a href="mailto:[EMAIL PROTECTED]";>Remy Maucherat</a>
  - * @version $Revision: 1.9 $
  + * @version $Revision: 1.10 $
    */
   public class FileContentStore extends AbstractService
       implements ContentStore {
  @@ -104,9 +104,6 @@
        */
       private boolean version = true;
       
  -    
  -    
  -    
       /**
        * True if content written from a prior server run should be removed.
        * WARNING: setting this option to true will remove all files, located
  @@ -114,6 +111,10 @@
        */
       private boolean removePriorContent = false;
       
  +    /**
  +     * Default rootpath is the current directory
  +     */
  +     private final String DEFAULT_ROOTPATH=".";
       
       // ---------------------------------------------------- ServiceImpl Methods
       
  @@ -132,7 +133,7 @@
           if (rootpath == null) {
               // Default is that files are stored starting in the
               // current directory
  -            rootpath = "";
  +            rootpath = DEFAULT_ROOTPATH;
           }
           String versionValue = (String) parameters.get("version");
           if (versionValue != null) {
  @@ -176,9 +177,10 @@
           throws ServiceInitializationFailedException {
           try {
               // remove prior content specified at rootPath
  -            if (removePriorContent) reset();
  +            if ((removePriorContent) && (!DEFAULT_ROOTPATH.equals(rootpath))) 
  +                reset();
               File baseDir = new File(rootpath);
  -                     getLogger().log("FileContentStore rootpath: " + 
baseDir.getAbsolutePath() ,Logger.INFO);
  +                     token.getLogger().log("FileContentStore rootpath: " + 
baseDir.getAbsolutePath() ,Logger.INFO);
               baseDir.mkdirs();
           } catch (Exception e) {
               e.printStackTrace();
  @@ -194,7 +196,6 @@
        */
       public void reset()
           throws ServiceResetFailedException {
  -        
           String[] filter = new String[1];
           filter[0] = "*.*";
           new slidestore.reference.fileDeleter.DeleterWalker(rootpath, filter );
  
  
  

Reply via email to