Package pt.webdetails.cpf.repository.api

Examples of pt.webdetails.cpf.repository.api.IRWAccess.saveFile()


    }

    structure = addDashboardStyleAndRendererTypeToTemplate( structure );

    byte[] fileData = structure.getBytes( CharsetHelper.getEncoding() );
    if ( !access.saveFile( Utils.joinPath( REPOSITORY_CDF_DD_TEMPLATES_CUSTOM, file ), new ByteArrayInputStream(
        fileData ) ) ) {
      throw new DashboardStructureException( Messages
          .getString( "DashboardStructure.ERROR_006_SAVE_FILE_ADD_FAIL_EXCEPTION" ) );
    }
  }
View Full Code Here


    // and generate a fake global message file. So this way we're sure that we always have the file
    String localizedMsgGlobalName = BASE_GLOBAL_MESSAGE_SET_FILENAME + "_" + locale.getLanguage() + ".properties";

    if ( userContentAccess.fileExists( localizedMsgGlobalName ) ) {

      systemWriter.saveFile( localizedMsgGlobalName, userContentAccess.getFileInputStream( localizedMsgGlobalName ) );

    } else if ( globalBaseMessageFile != null ) {

      systemWriter.saveFile( localizedMsgGlobalName, globalBaseMessageFile.getContents() );
    }
View Full Code Here

      systemWriter.saveFile( localizedMsgGlobalName, userContentAccess.getFileInputStream( localizedMsgGlobalName ) );

    } else if ( globalBaseMessageFile != null ) {

      systemWriter.saveFile( localizedMsgGlobalName, globalBaseMessageFile.getContents() );
    }

    // Append specific message file only if it exists otherwise just use the global message files
    if ( sourceDashboardBaseMsgFile != null ) {
View Full Code Here

    }

    // Append specific message file only if it exists otherwise just use the global message files
    if ( sourceDashboardBaseMsgFile != null ) {

      systemWriter.saveFile( sourceDashboardBaseMsgFile.getName(), sourceDashboardBaseMsgFile.getContents() );

      String localizedMsgTargetName =
          FilenameUtils.getBaseName( sourceDashboardBaseMsgFile.getName() ) + "_" + locale.getLanguage()
              + ".properties";
View Full Code Here

          FilenameUtils.getBaseName( sourceDashboardBaseMsgFile.getName() ) + "_" + locale.getLanguage()
              + ".properties";

      if ( userContentAccess.fileExists( localizedMsgTargetName ) ) {

        systemWriter.saveFile( localizedMsgTargetName, userContentAccess.getFileInputStream( localizedMsgTargetName ) );
      }
    }
  }

  protected void copyStdGlobalMessageFileToCache() throws IOException {
View Full Code Here

    }

    // 3. CDE


    if ( !access.saveFile( cdeFilePath, new ByteArrayInputStream( safeGetEncodedBytes( cdfdeJsText ) ) ) ) {
      throw new DashboardStructureException(
        Messages.getString( "DashboardStructure.ERROR_006_SAVE_FILE_ADD_FAIL_EXCEPTION" ) );
    }

    // 3. CDA
View Full Code Here

      access.deleteFile( cdaFileName );

    } else {
      // throws Exception ????
      String cdaText = cdaRenderer.render();
      if ( !access.saveFile( cdaFileName, new ByteArrayInputStream( safeGetEncodedBytes( cdaText ) ) ) ) {
        throw new DashboardStructureException(
          Messages.getString( "DashboardStructure.ERROR_006_SAVE_FILE_ADD_FAIL_EXCEPTION" ) );
      }
    }
View Full Code Here

    IACAccess access = loader.getAccessControl();
    IRWAccess writer = loader.getWriter();

    String msg;
    if ( access.hasAccess( path, FileAccess.WRITE ) ) {
      if ( writer.saveFile( path, new ByteArrayInputStream( data.getBytes( CharsetHelper.getEncoding() ) ) ) ) {
        msg = "file '" + path + "' saved ok";
        logger.debug( msg );
      } else {
        msg = "error saving file " + path;
        logger.error( msg );
View Full Code Here

    IACAccess access = loader.getAccessControl();
    IRWAccess writer = loader.getWriter();

    String msg;
    if ( access.hasAccess( FilenameUtils.getFullPath( path ), FileAccess.WRITE ) ) {
      if ( writer.saveFile( path, new ByteArrayInputStream( data.getBytes( CharsetHelper.getEncoding() ) ) ) ) {
        msg = "file '" + path + "' saved ok";
        logger.debug( msg );
      } else {
        msg = "error saving file " + path;
        logger.error( 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.