Package pt.webdetails.cpf.repository.api

Examples of pt.webdetails.cpf.repository.api.IReadAccess.fileExists()


      return null;
    }

    boolean cacheInvalid =
      ( userContentAccess.getLastModified( cdeFilePath ) > dashLoadedDate.getTime() )
        || ( userContentAccess.fileExists( templPath )
        && userContentAccess.getLastModified( templPath ) > dashLoadedDate.getTime() );
    if ( cacheInvalid ) {
      _logger.info( "Cached dashboard render invalidated, re-rendering." );
      return null;
    }
View Full Code Here


      IReadAccess systemReader =
          CdeEnvironment.getPluginSystemReader( Utils.joinPath( BASE_CACHE_DIR, msgsRelativeDir ) );

      String msg = BASE_GLOBAL_MESSAGE_SET_FILENAME + ".properties";

      if ( systemReader.fileExists( msg ) ) {
        globalMsgCacheFile = systemReader.fetchFile( msg );
      }
    }

    return globalMsgCacheFile;
View Full Code Here

        cdeFileInput =
          CdeEnvironment.getPluginSystemReader().getFileInputStream( SYSTEM_PLUGIN_EMPTY_STRUCTURE_FILE_PATH );
        wcdfFilePath = SYSTEM_PLUGIN_EMPTY_WCDF_FILE_PATH;
      } else {
        IReadAccess access = Utils.getSystemOrUserReadAccess( cdeFilePath );
        if ( access.fileExists( cdeFilePath ) ) {
          cdeFileInput = access.getFileInputStream( cdeFilePath );
          wcdfFilePath = cdeFilePath.replace( ".cdfde", ".wcdf" );
        } else {
          String msg = "File not found " + cdeFilePath + " in " + access;
          logger.error( msg );
View Full Code Here

    throws IOException {

    IResourceLoader loader = getResourceLoader( path );
    IReadAccess reader = loader.getReader();

    if ( reader.fileExists( path ) && loader.getAccessControl().hasAccess( path, FileAccess.READ ) ) {
      response.setHeader( "Cache-Control", "max-age=" + NO_CACHE_DURATION );
      return IOUtils.toString( reader.getFileInputStream( path ) );
    } else {
      String msg = "File: " + path + " does not exist, or you do not have permissions to access it";
      logger.error( msg );
View Full Code Here

    IACAccess access = loader.getAccessControl();


    String msg;
    if ( access.hasAccess( path, FileAccess.WRITE ) ) {
      if ( reader.fileExists( path ) ) {
        msg = "already exists: " + path;
        logger.debug( msg );
      } else {
        if ( writer.createFolder( path ) ) {
          msg = path + "created ok";
View Full Code Here

  @Path( "/getExternalEditor" )
  @Produces( "text/html" )
  @Consumes( { APPLICATION_XML, APPLICATION_JSON } )
  public String externalEditor() throws IOException {
    IReadAccess access = CdeEnvironment.getPluginSystemReader();
    if ( access.fileExists( EXTERNAL_EDITOR_PAGE ) ) {
      return IOUtils.toString( access.getFileInputStream( EXTERNAL_EDITOR_PAGE ) );
    } else {
      String msg = "External editor not found: " + EXTERNAL_EDITOR_PAGE;
      logger.error( msg );
      return msg;
View Full Code Here

  @Path( "/getComponentEditor" )
  @Produces( "text/html" )
  @Consumes( { APPLICATION_XML, APPLICATION_JSON } )
  public String componentEditor() throws IOException {
    IReadAccess access = CdeEnvironment.getPluginSystemReader();
    if ( access.fileExists( COMPONENT_EDITOR_PAGE ) ) {
      return IOUtils.toString( access.getFileInputStream( COMPONENT_EDITOR_PAGE ) );
    } else {
      String msg = "no external editor found: " + COMPONENT_EDITOR_PAGE;
      logger.error( msg );
      return msg;
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.