Class FsProducer

    • Constructor Detail

      • FsProducer

        public FsProducer()
    • Method Detail

      • addProducerMetadata

        protected void addProducerMetadata​(AdaptrisMessage msg,
                                           java.io.File destFile)
                                    throws java.io.IOException
        Throws:
        java.io.IOException
      • write

        protected void write​(AdaptrisMessage msg,
                             java.io.File destFile)
                      throws java.lang.Exception
        Throws:
        java.lang.Exception
      • createTempFile

        protected java.io.File createTempFile​(AdaptrisMessage msg)
                                       throws java.lang.Exception
        Throws:
        java.lang.Exception
      • validateDir

        protected void validateDir​(java.net.URL url)
                            throws java.io.IOException
        Throws:
        java.io.IOException
      • shouldCreateDirs

        protected boolean shouldCreateDirs()
      • withBaseDirectoryUrl

        public <T extends FsProducer> T withBaseDirectoryUrl​(java.lang.String s)
      • getCreateDirs

        public java.lang.Boolean getCreateDirs()
        Specify whether to create directories that do not exist.

        If this flag has been set, then an attempt to create the directory is made, if the directory does not exist. The default is false if not explicitly configured.

      • setCreateDirs

        public void setCreateDirs​(java.lang.Boolean createDirs)
        Specify whether to create directories that do not exist.

        If this flag has been set, then an attempt to create the directory is made, if the directory does not exist. The default is false if not explicitly configured.

      • getTempDirectory

        public java.lang.String getTempDirectory()
        The temporary directory for initially writing files to.

        In some instances, for instance, writing to network shares, it may be preferable to initial write to a temporary directory and then move the resulting file to the final location. Setting this to a non-null value will cause a temporary file to be created in this directory; this is then renamed to the correct location using File.renameTo(File).

      • setTempDirectory

        public void setTempDirectory​(java.lang.String tempDirectory)
        The temporary directory for initially writing files to.

        In some instances, for instance, writing to network shares, it may be preferable to initial write to a temporary directory and then move the resulting file to the final location. Setting this to a non-null value will cause a temporary file to be created in this directory; this is then renamed to the correct location using File.renameTo(File).

      • getFsWorker

        @NonNull
        public @NonNull FsWorker getFsWorker()
        The FsWorker implementation to use when performing write operations.

        The default is NioWorker if not explicitly configured

      • setFsWorker

        public void setFsWorker​(@NonNull
                                @NonNull FsWorker fsWorker)
        The FsWorker implementation to use when performing write operations.

        The default is NioWorker if not explicitly configured

      • setFilenameCreator

        public void setFilenameCreator​(@NonNull
                                       @NonNull FileNameCreator filenameCreator)
        Sets the FileNameCreator.

        The default is FormattedFilenameCreator if not explicitly configured

      • getBaseDirectoryUrl

        public java.lang.String getBaseDirectoryUrl()
        The base directory specified as a URL.
      • setBaseDirectoryUrl

        public void setBaseDirectoryUrl​(java.lang.String baseDirectoryUrl)
        The base directory specified as a URL.