Package com.baasbox.dao.exception

Examples of com.baasbox.dao.exception.FileNotFoundException


    }
   
    public static void deleteById(String id) throws Throwable, SqlInjectionException, FileNotFoundException{
      FileDao dao = FileDao.getInstance();
      ODocument file=getById(id);
      if (file==null) throw new FileNotFoundException();
      dao.delete(file.getIdentity());
    }
View Full Code Here


    public static ODocument grantPermissionToRole(String id,Permissions permission, String rolename)
        throws RoleNotFoundException, FileNotFoundException, SqlInjectionException, InvalidModelException {
      ORole role=RoleDao.getRole(rolename);
      if (role==null) throw new RoleNotFoundException(rolename);
      ODocument doc = getById(id);
      if (doc==null) throw new FileNotFoundException(id);
      return PermissionsHelper.grant(doc, permission, role);
    }
View Full Code Here

    public static ODocument revokePermissionToRole(String id,
        Permissions permission, String rolename) throws RoleNotFoundException, FileNotFoundException, SqlInjectionException, InvalidModelException  {
      ORole role=RoleDao.getRole(rolename);
      if (role==null) throw new RoleNotFoundException(rolename);
      ODocument doc = getById(id);
      if (doc==null) throw new FileNotFoundException(id);
      return PermissionsHelper.revoke(doc, permission, role);
   
View Full Code Here

   
    public static ODocument grantPermissionToUser(String id, Permissions permission, String username) throws UserNotFoundException, RoleNotFoundException, FileNotFoundException, SqlInjectionException, IllegalArgumentException, InvalidModelException  {
      OUser user=UserService.getOUserByUsername(username);
      if (user==null) throw new UserNotFoundException(username);
      ODocument doc = getById(id);
      if (doc==null) throw new FileNotFoundException(id);
      return PermissionsHelper.grant(doc, permission, user);
    }
View Full Code Here

    public static ODocument revokePermissionToUser(String id, Permissions permission, String username) throws UserNotFoundException, RoleNotFoundException, FileNotFoundException, SqlInjectionException, IllegalArgumentException, InvalidModelException {
      OUser user=UserService.getOUserByUsername(username);
      if (user==null) throw new UserNotFoundException(username);
      ODocument doc = getById(id);
      if (doc==null) throw new FileNotFoundException(id);
      return PermissionsHelper.revoke(doc, permission, user);
    }
View Full Code Here

      return (String) file.field(CONTENT_TYPE_FIELD_NAME);
    }
   
    public static String getExtractedContent(String id) throws SqlInjectionException, InvalidModelException, FileNotFoundException {
      ODocument file = getById(id);
      if (file==null) throw new  FileNotFoundException();
      FileDao dao = FileDao.getInstance();
      String ret=dao.getExtractedContent(file);
      return ret;
    }
View Full Code Here

  public static String exportDb(String appcode) throws FileNotFoundException{
    java.io.File dir = new java.io.File(backupDir);
    if(!dir.exists()){
      boolean createdDir = dir.mkdirs();
      if(!createdDir){
        throw new FileNotFoundException("unable to create backup dir");
      }
    }
    SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd-HHmmss");
    String fileName = String.format("%s-%s.zip", sdf.format(new Date()),FileSystemPathUtil.escapeName(appcode));
    //Async task
View Full Code Here

  }
 
  public static void deleteExport(String fileName) throws FileNotFoundException, IOException{
    java.io.File file = new java.io.File(backupDir+fileSeparator+fileName);
    if(!file.exists()){
      throw new FileNotFoundException("Export " + fileName + " not found");
    }else{
      boolean deleted = false;
      try{
        FileUtils.forceDelete(file);
        deleted =true;
View Full Code Here

TOP

Related Classes of com.baasbox.dao.exception.FileNotFoundException

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.