Class ComponentCopyTool

java.lang.Object
com.zfabrik.dev.util.ComponentCopyTool

public class ComponentCopyTool extends Object
  • Constructor Details

    • ComponentCopyTool

      public ComponentCopyTool()
  • Method Details

    • inspectComponent

      public static FSCRDBComponent inspectComponent(String cn) throws IOException
      Inpect a component and create a component repository implementation that holds more meta data. In particular whether there is resources other than properties.
      Throws:
      IOException
    • copyComponentResources

      public static void copyComponentResources(String cn, File target, ComponentCopyTool.Mode mode) throws Exception
      Copy a component's resource folder into target. Depending on the mode setting, source files and folders may be stripped while copying. Note that this operation may trigger a compilation step. This method expects a FSCRDBComponent object as created from inspectComponent(String).
      Throws:
      Exception
    • writeProperties

      public static void writeProperties(String cn, File targetFolder) throws Exception
      Create a component's property file, if the component has only properties and no resource folder
      Throws:
      Exception
    • copyComponentToRepositoryFolder

      public static void copyComponentToRepositoryFolder(String cn, File target, ComponentCopyTool.Mode mode) throws Exception
      Copy a component into a file system component resource format. That is, the component layout will be rebuild in the target folder, as if to be fed into another standard component repository. I.e. if the component has properties only, a file

      <module>/<component>.properties

      will be created, and if the component has resources, the complete folder structure

      <module>/<component>

      will be created. Depending on the mode setting, source files and folders may be stripped while copying. Note that this operation may trigger a Java compilation.
      Parameters:
      cn -
      target -
      mode -
      Throws:
      Exception