Class WindowsPlatform


  • public final class WindowsPlatform
    extends java.lang.Object
    Platform specific behavior for Microsoft Windows.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private WindowsPlatform()
      Constructor.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void addVersionFiles​(VersionInfo versionInfo, LinkType linkType, java.io.File outputFile, boolean isDebug, java.io.File objDir, TargetMatcher matcher)
      Adds source or object files to the bidded fileset to support version information.
      private static void encodeVersion​(java.lang.StringBuffer buf, short[] version)
      Converts parsed version information into a string representation.
      private static boolean hasSameContent​(java.io.InputStream stream1, java.io.InputStream stream2)
      Compare two input streams for duplicate content Naive implementation, but should not be performance issue.
      static short[] parseVersion​(java.lang.String version)
      Parse version string into array of four short values.
      static void writeResource​(java.io.Writer writer, VersionInfo versionInfo, java.io.File outputFile, boolean isDebug, LinkType linkType)
      Writes windows resource.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • WindowsPlatform

        private WindowsPlatform()
        Constructor.
    • Method Detail

      • addVersionFiles

        public static void addVersionFiles​(VersionInfo versionInfo,
                                           LinkType linkType,
                                           java.io.File outputFile,
                                           boolean isDebug,
                                           java.io.File objDir,
                                           TargetMatcher matcher)
                                    throws java.io.IOException
        Adds source or object files to the bidded fileset to support version information.
        Parameters:
        versionInfo - version information
        linkType - link type
        isDebug - true if debug build
        outputFile - name of generated executable
        objDir - directory for generated files
        matcher - bidded fileset
        Throws:
        java.io.IOException - if unable to write version resource
      • hasSameContent

        private static boolean hasSameContent​(java.io.InputStream stream1,
                                              java.io.InputStream stream2)
                                       throws java.io.IOException
        Compare two input streams for duplicate content Naive implementation, but should not be performance issue.
        Parameters:
        stream1 - stream
        stream2 - stream
        Returns:
        true if streams are identical in content
        Throws:
        java.io.IOException - if error reading streams
      • parseVersion

        public static short[] parseVersion​(java.lang.String version)
        Parse version string into array of four short values.
        Parameters:
        version - String version
        Returns:
        short[] four element array
      • encodeVersion

        private static void encodeVersion​(java.lang.StringBuffer buf,
                                          short[] version)
        Converts parsed version information into a string representation.
        Parameters:
        buf - StringBuffer string buffer to receive version number
        version - short[] four-element array
      • writeResource

        public static void writeResource​(java.io.Writer writer,
                                         VersionInfo versionInfo,
                                         java.io.File outputFile,
                                         boolean isDebug,
                                         LinkType linkType)
                                  throws java.io.IOException
        Writes windows resource.
        Parameters:
        writer - writer, may not be nul
        versionInfo - version information
        outputFile - executable file
        isDebug - true if debug
        linkType - link type
        Throws:
        java.io.IOException - if error writing resource file