Package pt.webdetails.cpf.repository.api

Examples of pt.webdetails.cpf.repository.api.IUserContentAccess.deleteFile()


      IUserContentAccess access = contentAccessFactory.getUserContentAccess(null);

      if( !access.fileExists(file) && access.hasAccess(file, FileAccess.DELETE)) {
        throw new SaikuServiceException("Access to Repository has failed File does not exist or no delete right: " + file);
      }
      boolean ok = access.deleteFile(file);
      if (!ok) {
        throw new SaikuServiceException("Failed to write file: " + file);
      }
      return Response.ok().build();
    }
View Full Code Here


  public void deleteFile( OutputStream out ) throws PentahoAccessControlException, IOException {

    String path = getRequestParameters().getStringParameter( MethodParams.PATH, null );

    IUserContentAccess access = CdeEnvironment.getUserContentAccess();
    if ( access.hasAccess( path, FileAccess.DELETE ) && access.deleteFile( path ) ) {
      writeOut( out, "file  " + path + " removed ok" );
    } else {
      writeOut( out, "Error removing " + path );
    }
  }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.