Class LicenseWriter

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable

    public class LicenseWriter
    extends java.lang.Object
    implements java.io.Closeable
    Write the license into the output
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()  
      void write​(License license)
      Write the license to the output in binary format.
      void write​(License license, IOFormat format)
      Write the license into the output.
      • Methods inherited from class java.lang.Object

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

      • LicenseWriter

        public LicenseWriter​(java.io.OutputStream os)
      • LicenseWriter

        public LicenseWriter​(java.io.File file)
                      throws java.io.FileNotFoundException
        Throws:
        java.io.FileNotFoundException
      • LicenseWriter

        public LicenseWriter​(java.lang.String fileName)
                      throws java.io.FileNotFoundException
        Throws:
        java.io.FileNotFoundException
    • Method Detail

      • write

        public void write​(License license,
                          IOFormat format)
                   throws java.io.IOException
        Write the license into the output.
        Parameters:
        license - the license itself
        format - the desired format of the license, can be IOFormat.STRING, IOFormat.BASE64 or IOFormat.BINARY
        Throws:
        java.io.IOException - if the output cannot be written
      • write

        public void write​(License license)
                   throws java.io.IOException
        Write the license to the output in binary format.
        Parameters:
        license - to write to the file
        Throws:
        java.io.IOException - if the output cannot be written
      • close

        public void close()
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable