Class FlexBuildArtifacts

java.lang.Object
flexagon.fd.core.plugin.FlexBuildArtifacts

public class FlexBuildArtifacts extends Object
Utility class to help build artifact zip file for partial deploy operations.
  • Field Details

  • Constructor Details

  • Method Details

    • getContext

      public WorkflowExecutionContext getContext()
    • getTargetDirectory

      public String getTargetDirectory()
    • getZipFileName

      public String getZipFileName()
    • getSourceDirectories

      public List<String> getSourceDirectories()
    • generateZIPArtifact

      public List<PackageObject> generateZIPArtifact(List<PackageObject> pPackageObjects) throws FlexCheckedException
      Utility for Partial Deployments. Generates ZIP artifact for ProjectObjects. This utility adds the Hash to the Object and returns ProjectObjects back as IN-Out parameter.
      Throws:
      FlexCheckedException
    • finalizePackageObjects

      public List<PackageObject> finalizePackageObjects(List<PackageObject> pPackageObjects, boolean pZipObjects) throws FlexCheckedException
      Throws:
      FlexCheckedException
    • includeObjectInZip

      protected boolean includeObjectInZip(ProjectObject projectObject)
      This is used by classes that extend it to determine if files should be included in the zip.
      Returns:
      boolean, whether to include a project object in the zip file
    • checkFolder

      protected File checkFolder(String pTargetFolder)
      Parameters:
      pTargetFolder - the folder to check if it's a real folder
      Returns:
      File if it's a real folder, otherwise a FlexInvalidArgumentException is thrown.
    • getFile

      protected File getFile(String pSourceFolder, String pFile)
    • calculateDirectoryHash

      protected String calculateDirectoryHash(File dirToHash) throws FlexCheckedException
      This is not common but during build all files in a folder are used to calculate hash of entire folder.
      Returns:
      hash string of the directory
      Throws:
      FlexCheckedException
    • calculateFileHash

      protected String calculateFileHash(File pFile) throws FlexCheckedException
      This is most commonly used during build as most partial deployment project work with individual files.
      Returns:
      hash string of the file
      Throws:
      FlexCheckedException
    • calculateHash

      protected String calculateHash(ProjectObject projectObject)
      If isMetaDataOnlyProjectObject then we do not have enough details to calculate hash, so just use System.currentTimeMillis in this case.
      Returns:
      hash string of a metadata only Project Object
    • checkFileInSource

      public File checkFileInSource(String pFile, boolean pThrowException)
    • isMetaDataOnlyProjectObject

      protected boolean isMetaDataOnlyProjectObject(ProjectObject pProjectObject)
    • prepareTempFileCollectionFolder

      protected void prepareTempFileCollectionFolder(File pTempFileCollectionFolder) throws FlexCheckedException
      Overridden by subclasses to add any files to the collection folder which should be part of the zip even if they are not included in package. This is used if there are other supported files needed on the deploy side.
      Throws:
      FlexCheckedException