Package com.stimulus.archiva.exception

Examples of com.stimulus.archiva.exception.ConfigurationException


          f = File.createTempFile("server","conf");
            prop.store(intro, new FileOutputStream(f));
        } catch (Exception e) {
          if (f!=null)
            f.delete();
            throw new ConfigurationException("failed to save properties. cause:"+e.toString(),e, logger);
        }
        File newFile = new File(name);
        newFile.delete();
        f.renameTo(newFile);
    }
View Full Code Here


       
        if (newStatus!=Status.EJECTED) {
          switch(status) {
            case CLOSED:
              if (newStatus!=Status.UNMOUNTED)
                throw new ConfigurationException("failed to change volume status. it is closed {newstatus='"+status+"'}",logger);
                break;
            case ACTIVE: if (newStatus!=Status.CLOSED)
                       throw new ConfigurationException("failed to change volume status. it can only be closed {newstatus='"+status+"'}",logger);
                   break;
            case UNUSED: if (newStatus!=Status.ACTIVE)
                       throw new ConfigurationException("failed to change volume status. it can only be made active {newstatus='"+status+"'}",logger);
                   break;
            case NEW: if (newStatus!=Status.UNUSED)
                    throw new ConfigurationException("failed to change volume status. it can only be made active {newstatus='"+status+"'}",logger);
                  break;
            case UNMOUNTED: if (newStatus!=Status.CLOSED)
              throw new ConfigurationException("failed to change volume status. it can only be closed {newstatus='"+status+"'}",logger);
              break;
            default: throw new ConfigurationException("failed to change volume status. internal status is set to invalid value.",logger);
          }
        }
        status = newStatus;
    }
View Full Code Here

            prop.store(intro, new FileOutputStream(f),charset);
         
        } catch (Exception e) {
          if (f!=null)
            f.delete();
            throw new ConfigurationException("failed to save properties. cause:"+e.toString(),e, logger);
        }
        File newFile = new File(name);
        newFile.delete();
        f.renameTo(newFile);
    }
View Full Code Here

             return;
        logger.debug("setting volume status {newStatus='"+newStatus+"',"+ toString()+"}");
        switch(status) {
            case CLOSED:
              if (newStatus!=Status.UNMOUNTED)
                throw new ConfigurationException("failed to change volume status. it is closed {newstatus='"+status+"'}",logger);
                break;
            case ACTIVE: if (newStatus!=Status.CLOSED)
                       throw new ConfigurationException("failed to change volume status. it can only be closed {newstatus='"+status+"'}",logger);
                   break;
            case UNUSED: if (newStatus!=Status.ACTIVE)
                       throw new ConfigurationException("failed to change volume status. it can only be made active {newstatus='"+status+"'}",logger);
                   break;
            case NEW: if (newStatus!=Status.UNUSED)
                    throw new ConfigurationException("failed to change volume status. it can only be made active {newstatus='"+status+"'}",logger);
                  break;
            case UNMOUNTED: if (newStatus!=Status.CLOSED)
              throw new ConfigurationException("failed to change volume status. it can only be closed {newstatus='"+status+"'}",logger);
              break;
            default: throw new ConfigurationException("failed to change volume status. internal status is set to invalid value.",logger);
      }
      
        status = newStatus;
    }
View Full Code Here

        File storeFile = new File(getPath());
       
        if (!indexFile.exists()) {
          boolean createIndexDir = indexFile.mkdirs();
          if (!createIndexDir) {
            throw new ConfigurationException("unable to create volume index directory:"+getIndexPath(),logger);
          }
        }
        if (!storeFile.exists()) {
          boolean createStoreDir = storeFile.mkdirs();
          if (!createStoreDir) {
           throw new ConfigurationException("unable to create volume store directory:"+getPath(),logger);
          }
        }
      
        if (!Config.getFileSystem().checkReadWriteDeleteAccess(getIndexPath())) {
          throw new ConfigurationException("there insufficient read/write/delete permissions on volume index:"+getIndexPath(),logger);
        }
       
        if (!Config.getFileSystem().checkReadWriteDeleteAccess(getPath())) {
          throw new ConfigurationException("there insufficient read/write/delete permissions on volume store:"+getPath(),logger);
        }
      }
View Full Code Here

  protected static void saveProperties( final String name, Properties prop) throws ConfigurationException {
      try {
          File f = new File(name);
          prop.store(new FileOutputStream(f), null);
      } catch (Exception e) {
          throw new ConfigurationException("failed to save properties. cause:"+e.toString(),e, logger);
      }
  }
View Full Code Here

      protected static void saveProperties( final String name, MailArchivaProperties prop) throws ConfigurationException {
          try {
              File f = new File(name);
              prop.store(new FileOutputStream(f));
          } catch (Exception e) {
              throw new ConfigurationException("failed to save properties. cause:"+e.toString(),e, logger);
          }
      }
View Full Code Here

         return role;
       }
      
       public void setRole(String role) throws ConfigurationException {
          if (!ROLES.contains(role))
                throw new ConfigurationException("failed to set role in role mapping {role='"+role+"'}",logger);
         this.role = role;
       }
View Full Code Here

       }
      
     public void setRoleID(int roleId) throws ConfigurationException {
          String newrole = (String)ROLES.get(roleId);
          if (newrole==null)
              throw new ConfigurationException("failed to set role. invalid role id "+role,logger);
          this.role = newrole;
      }
View Full Code Here

     
          if (status==newStatus)
             return;
         
        switch(status) {
          case CLOSED: throw new ConfigurationException("failed to change volume status. it is closed {newstatus='"+status+"'}",logger);
          case ACTIVE: if (newStatus!=Status.CLOSED)
                     throw new ConfigurationException("failed to change volume status. it can only be closed {newstatus='"+status+"'}",logger);
                 break;
          case UNUSED: if (newStatus!=Status.ACTIVE)
                     throw new ConfigurationException("failed to change volume status. it can only be made active {newstatus='"+status+"'}",logger);
                 break;
          case NEW: if (newStatus!=Status.UNUSED)
                  throw new ConfigurationException("failed to change volume status. it can only be made active {newstatus='"+status+"'}",logger);
                break;
          default: throw new ConfigurationException("failed to change volume status. internal status is set to invalid value.",logger);
        }
        status = newStatus;
    }
View Full Code Here

TOP

Related Classes of com.stimulus.archiva.exception.ConfigurationException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.