Klasse IOHelper

java.lang.Object
net.simplace.core.service.IOHelper

public final class IOHelper extends Object
provides different helper methods for IO
Autor:
Andreas Enders
  • Felddetails

    • PATH_BACK_PATTERN

      public static final Pattern PATH_BACK_PATTERN
      For the replacement of the '..' in paths
  • Methodendetails

    • getFileExtension

      public static final String getFileExtension(String aFullFileName)
      Parameter:
      aFullFileName -
      Gibt zurück:
      the extension of a given full File name.
    • getFilename

      public static final String getFilename(String aFullFileName)
      Parameter:
      aFullFileName -
      Gibt zurück:
      the name part of a given full file name (without directory pathes).
    • getFilenameWithExtension

      public static String getFilenameWithExtension(String aFullFileName)
      Parameter:
      aFullFileName -
      Gibt zurück:
      the name with extension of a given full file name (without directory pathes).
    • getAllFileNamesInDirectory

      public static final Set<String> getAllFileNamesInDirectory(String aDirectory, String aExtension)
      Parameter:
      aDirectory -
      aExtension -
      Gibt zurück:
      all the file names with the given extension in a directory.
    • writeObjectToFile

      public static void writeObjectToFile(File aDestFile, Object aObject) throws FileNotFoundException, IOException
      Returns the name part of a given full file name (without directory pathes).
      Parameter:
      aDestFile -
      aObject -
      Löst aus:
      FileNotFoundException
      IOException
    • readObjectFromFile

      public static final Object readObjectFromFile(File aSourceFile) throws FileNotFoundException, IOException, Exception
      Parameter:
      aSourceFile -
      Gibt zurück:
      the name part of a given full file name (without directory pathes).
      Löst aus:
      FileNotFoundException
      IOException
      Exception
    • copyFiles

      public static final void copyFiles(File aSourceDir, File aDesDir) throws IOException
      Copies the content of the given directory to the given targetdirectory.
      Parameter:
      aSourceDir -
      aDesDir -
      Löst aus:
      IOException
    • copyFiles

      public static final void copyFiles(File aSourceDir, File aDesDir, FileFilter aFileFilter, boolean aShouldOverwrite) throws IOException
      Copies the content of the given directory to the given targetdirectory. Copies only files that match the given FileFilter.
      Parameter:
      aSourceDir -
      aDesDir -
      aFileFilter -
      aShouldOverwrite -
      Löst aus:
      IOException
    • copyDirectory

      public static void copyDirectory(File aSourceDirectory, File aDestinationDirectory, boolean aCopySubFolders, boolean aOverwriteCopy) throws IOException
      copies all contents of one folder to another one. use the last parameter to define, if you want to copy all subfolders including content
      Parameter:
      aSourceDirectory -
      aDestinationDirectory -
      aCopySubFolders -
      aOverwriteCopy -
      Löst aus:
      IOException
    • copyFile

      public static final void copyFile(File aSourceFile, File aDestFile, boolean aShouldOverwrite) throws FileNotFoundException, IOException
      Copy a file and create the directory structure for the destination file if it doesnt already exist. Overwrite the destination file if it already exists.
      Parameter:
      aSourceFile -
      aDestFile -
      aShouldOverwrite -
      Löst aus:
      FileNotFoundException - Thrown if the source file cannot be found.
      IOException - Thrown if an error occurs while copying.
    • moveFile

      public static final void moveFile(File aSourceFile, File aDestFile, boolean aShouldOverwrite) throws FileNotFoundException, IOException
      Copy a file and create the directory structure for the destination file if it doesnt already exist. Overwrite the destination file if it already exists.
      Parameter:
      aSourceFile -
      aDestFile -
      aShouldOverwrite -
      Löst aus:
      FileNotFoundException - Thrown if the source file cannot be found.
      IOException - Thrown if an error occurs while copying.
    • addLineToFile

      public static final void addLineToFile(File aFile, String aStringToAppend, int aMaxKBSizeOfFile) throws IOException
      Constructs a FileWriter object given a File object. String will be written to the end of the file.
      Parameter:
      aFile - a File object to write to, if doesn't exist it will be created.
      aStringToAppend - String that should be appended to the File
      aMaxKBSizeOfFile - max size of File
      Löst aus:
      IOException - if the file exists but is a directory rather than a regular file, does not exist but cannot be created, or cannot be opened for any other reason
    • readFirstCharsOfFile

      public static final String readFirstCharsOfFile(File aFile, int aNumberOfChars) throws IOException
      Reads the first chars of a File and returns it in a String.
      Parameter:
      aFile - a File object to read from.
      aNumberOfChars - if true, then bytes will be written to the end of the file rather than the beginning
      Gibt zurück:
      the first chars of a File and returns it in a String.
      Löst aus:
      IOException - if the file does not exist but cannot be created, or cannot be opened for any other reason
    • readLinesOfFile

      public static final Vector<String> readLinesOfFile(File aFile, String aEncoding, Integer[] aLinesToRead) throws IOException
      Reads the last line of a File and returns it in a String.
      Parameter:
      aFile - a File object to read from.
      aEncoding - if true, then bytes will be written to the end of the file rather than the beginning
      aLinesToRead -
      Gibt zurück:
      the last line of a File and returns it in a String.
      Löst aus:
      IOException - if the file does not exist but cannot be created, or cannot be opened for any other reason
    • readFile

      public static final String readFile(File aFile) throws IOException
      Reads the last line of a File and returns it in a String.
      Parameter:
      aFile - a File object to read from.
      Gibt zurück:
      the File and returns it in a String.
      Löst aus:
      IOException - if the file does not exist but cannot be created, or cannot be opened for any other reason
    • readFile

      public static final String readFile(File aFile, String aEncoding) throws IOException
      Reads the last line of a File and returns it in a String.
      Parameter:
      aFile - a File object to read from.
      aEncoding - if true, then bytes will be written to the end of the file rather than the beginning
      Gibt zurück:
      the File and returns it in a String.
      Löst aus:
      IOException - if the file does not exist but cannot be created, or cannot be opened for any other reason
    • getInputStream

      public static InputStream getInputStream(File aFile) throws IOException
      Parameter:
      aFile -
      Gibt zurück:
      a File's InputStream - either from Zip, GZ, TarGZ, Resource or simply the file
      Löst aus:
      IOException
    • getOutputStream

      public static final OutputStream getOutputStream(File aFile) throws IOException
      Creates an OutputStream using the special needs of samba shares and gz.
      Parameter:
      aFile -
      Gibt zurück:
      the output stream to write to
      Löst aus:
      IOException
    • readLinesOfFile

      public static final Vector<String> readLinesOfFile(File aFile) throws IOException
      Reads the last line of a File and returns it in a String.
      Parameter:
      aFile - a File object to read from.
      Gibt zurück:
      the last line of a File and returns it in a String.
      Löst aus:
      IOException - if the file does not exist but cannot be created, or cannot be opened for any other reason
    • readFileToArray

      public static String[][] readFileToArray(File aFileData, String aDivider, Integer[] aLinesToRead, Integer aSkipHeaderLines) throws IOException
      Reads a file to an array
      Parameter:
      aFileData - a File object to read from.
      aDivider - if true, then bytes will be written to the end of the file rather than the beginning
      aLinesToRead -
      aSkipHeaderLines -
      Gibt zurück:
      Double array of file content
      Löst aus:
      IOException - if the file does not exist but cannot be created, or cannot be opened for any other reason
    • readFileToArray

      public static String[][] readFileToArray(File aFileData, String aDivider, Integer[] aLinesToRead) throws IOException
      Reads a file to an array
      Parameter:
      aFileData - a File object to read from.
      aDivider - if true, then bytes will be written to the end of the file rather than the beginning
      aLinesToRead -
      Gibt zurück:
      Double array of file content
      Löst aus:
      IOException - if the file does not exist but cannot be created, or cannot be opened for any other reason
    • readLinesOfStream

      public static final Vector<String> readLinesOfStream(InputStream aInputStream, Integer[] aLinesToRead, String encoding) throws IOException
      Reads the last line of a File and returns it in a String.
      Parameter:
      aInputStream - a File object to read from.
      aLinesToRead -
      encoding - if true, then bytes will be written to the end of the file rather than the beginning
      Gibt zurück:
      line vector of stream
      Löst aus:
      IOException - if the file does not exist but cannot be created, or cannot be opened for any other reason
    • readStreamToArray

      public static String[][] readStreamToArray(InputStream aInputStream, String aDivider, String aEncoding) throws IOException
      Reads the last line of a File and returns it in a String.
      Parameter:
      aInputStream - a File object to read from.
      aDivider - divider character
      aEncoding - if true, then bytes will be written to the end of the file rather than the beginning
      Gibt zurück:
      a stream to an array with encoding
      Löst aus:
      IOException - if the file does not exist but cannot be created, or cannot be opened for any other reason
    • writeLinesOfFile

      public static final void writeLinesOfFile(Vector<String> aLinesVector, File aFile) throws IOException
      Reads the last line of a File and returns it in a String.
      Parameter:
      aLinesVector - if true, then bytes will be written to the end of the file rather than the beginning
      aFile - a File object to read from.
      Löst aus:
      IOException - if the file does not exist but cannot be created, or cannot be opened for any other reason
    • readLastLineOfFile

      public static final String readLastLineOfFile(File aFile) throws IOException
      Reads the last line of a File and returns it in a String.
      Parameter:
      aFile - a File object to read from.
      Gibt zurück:
      the last line of a File and returns it in a String.
      Löst aus:
      IOException - if the file does not exist but cannot be created, or cannot be opened for any other reason
    • stringBufferFromInputStream

      public static final StringBuffer stringBufferFromInputStream(InputStream aInputStream) throws IOException
      Read the contents of a String from an InputStream.
      Parameter:
      aInputStream -
      Gibt zurück:
      the contents of a String from an InputStream.
      Löst aus:
      IOException
    • stringBufferFromInputStream

      public static final StringBuffer stringBufferFromInputStream(InputStream aInputStream, String aEncoding) throws IOException
      Read the contents of a String from an InputStream.
      Parameter:
      aInputStream -
      aEncoding -
      Gibt zurück:
      the contents of a String from an InputStream.
      Löst aus:
      IOException
    • stringFromInputStream

      public static final String stringFromInputStream(InputStream aInputStream) throws IOException
      Read the contents of a String from an InputStream.
      Parameter:
      aInputStream -
      Gibt zurück:
      the contents of a String from an InputStream.
      Löst aus:
      IOException
    • stringFromInputStream

      public static final String stringFromInputStream(InputStream aInputStream, String aEncoding) throws IOException
      Read the contents of a String from an InputStream.
      Parameter:
      aInputStream -
      aEncoding -
      Gibt zurück:
      the contents of a String from an InputStream.
      Löst aus:
      IOException
    • encodedStringFromInputStream

      public static final String encodedStringFromInputStream(InputStream aInputStream, String aEncoding) throws IOException
      Returns the contents of a String from an InputStream in the given encoded format.
      Parameter:
      aInputStream -
      aEncoding -
      Gibt zurück:
      the contents of a String from an InputStream.
      Löst aus:
      IOException
    • encodedStringFromInputStream

      public static final String encodedStringFromInputStream(InputStream aInputStream) throws IOException
      Returns the contents of a String from an InputStream in the UTF-8 encoded format.
      Parameter:
      aInputStream -
      Gibt zurück:
      the contents of a String from an InputStream.
      Löst aus:
      IOException
    • platformDefaultToUTF8

      public static final String platformDefaultToUTF8(String aString) throws IOException
      Turns a String which was created using the platform standard encoding to an String which is encoded using UTF-8 encoding.
      Parameter:
      aString -
      Gibt zurück:
      a String as UTF encoding
      Löst aus:
      IOException
    • isXMLFileExtension

      public static final boolean isXMLFileExtension(String aExtension)
      Parameter:
      aExtension -
      Gibt zurück:
      if the extension belongs to an UTF-8 encoded XML file.
    • UTF8ToPlatformDefault

      public static final String UTF8ToPlatformDefault(String aString) throws IOException
      Turns a String which was created using the UTF-8 encoding to an String which is encoded using platform standard encoding.
      Parameter:
      aString -
      Gibt zurück:
      a String which was created using the UTF-8 encoding
      Löst aus:
      IOException
    • stringToOutputStream

      public static final void stringToOutputStream(String aString, OutputStream aOutputStream) throws IOException
      Write the contents of a String to an OutputStream. The Stream won't be closed at the end.
      Parameter:
      aString -
      aOutputStream -
      Löst aus:
      IOException
    • stringBufferToOutputStream

      public static final void stringBufferToOutputStream(StringBuffer aStringBuffer, OutputStream aOutputStream) throws IOException
      Write the contents of a StringBuffer to an OutputStream. The Stream won't be closed at the end.
      Parameter:
      aStringBuffer -
      aOutputStream -
      Löst aus:
      IOException
    • stringToOutputStreamAndClose

      public static final void stringToOutputStreamAndClose(String aString, OutputStream aOutputStream) throws IOException
      Write the contents of a String to an OutputStream. The Stream will be closed at the end.
      Parameter:
      aString -
      aOutputStream -
      Löst aus:
      IOException
    • stringToOutputStream

      public static final void stringToOutputStream(String aString, OutputStream aOutputStream, String aEncoding) throws IOException
      Write the contents of a String to an OutputStream in the given encoding. The Stream won't be closed at the end.
      Parameter:
      aString -
      aOutputStream -
      aEncoding -
      Löst aus:
      IOException
    • stringToOutputStreamAndClose

      public static final void stringToOutputStreamAndClose(String aString, OutputStream aOutputStream, String aEncoding) throws IOException
      Write the contents of a String to an OutputStream in the given encoding. The Stream will be closed at the end.
      Parameter:
      aString -
      aOutputStream -
      aEncoding -
      Löst aus:
      IOException
    • stringToFile

      public static final void stringToFile(String aString, File aFile, String aEncoding) throws IOException
      Write the contents of a String to a File in the given encoding. The Stream will be closed at the end.
      Parameter:
      aString -
      aFile -
      aEncoding -
      Löst aus:
      IOException
    • stringToFile

      public static final void stringToFile(String aString, File aFile) throws IOException
      Write the contents of a String to a File in platform standard encoding. The Stream will be closed at the end.
      Parameter:
      aString -
      aFile -
      Löst aus:
      IOException
    • fileToOutputStream

      public static final void fileToOutputStream(File aFile, OutputStream aOutputStream) throws IOException
      Copy data from a file to an OututStream.
      Parameter:
      aFile -
      aOutputStream -
      Löst aus:
      IOException
    • fileFromInputStream

      public static final void fileFromInputStream(File aFile, InputStream aInputStream) throws IOException
      Copy data from an InputStream to a file.
      Parameter:
      aFile -
      aInputStream -
      Löst aus:
      IOException
    • copyStream

      public static final void copyStream(InputStream aInputStream, OutputStream aOutputStream) throws IOException
      Copy data from an InputStream to an OutputStream.
      Parameter:
      aInputStream -
      aOutputStream -
      Löst aus:
      IOException
    • copyStream

      public static final void copyStream(Reader aReader, Writer aWriter) throws IOException
      Copy data from an Reader to an Writer.
      Parameter:
      aReader -
      aWriter -
      Löst aus:
      IOException
    • createDir

      public static final void createDir(File aDir) throws IOException
      Create a directory including its parent directories if they dont already exist.
      Parameter:
      aDir -
      Löst aus:
      IOException
    • deleteFile

      public static final boolean deleteFile(File aFile)
      Delete a file if it exists.
      Parameter:
      aFile -
      Gibt zurück:
      success
    • getFiles

      public static final List<File> getFiles(File aFile, boolean aShouldIncludeSubdirs)
      Parameter:
      aFile -
      aShouldIncludeSubdirs -
      Gibt zurück:
      all the file objects within a directory(and also sub directories) excluding the directories in it (Excluding the directory file objects.).
    • getFilesForPattern

      public static final List<File> getFilesForPattern(File aFile, String aRegexpPattern, boolean aShouldIncludeSubdirs, boolean aIgnoreCase)
      Parameter:
      aFile -
      aRegexpPattern -
      aShouldIncludeSubdirs -
      aIgnoreCase -
      Gibt zurück:
      all the file objects within a directory(and also sub directories) excluding the directories in it (Excluding the directory file objects.).
    • deleteFiles

      public static final void deleteFiles(File aFile) throws IOException
      Deletes all the files in a directory including the sub directories files, if the given file is a directory. !!!The sub directories won't be deleted!!!
      Parameter:
      aFile -
      Löst aus:
      IOException
    • deleteFiles

      public static void deleteFiles(File aSourceDir, FileFilter aFileFilter)
      Parameter:
      aSourceDir -
      aFileFilter - Deletes all the files accepted in the fileFilter returning true if successful
    • deleteFiles

      public static final boolean deleteFiles(Collection<File> aFilesCollection)
      Deletes all the files in the given FilesCollection returning true if successful
      Parameter:
      aFilesCollection -
      Gibt zurück:
      success
    • deleteDir

      public static final boolean deleteDir(File dir)
      Deletes all the files in a directory including the sub directories files, if the given file is a directory and also the directory.
      Parameter:
      dir -
      Gibt zurück:
      success
    • deleteDir

      public static final boolean deleteDir(File dir, boolean goOnWithError)
      Deletes all the files in a directory including the sub directories files, if the given file is a directory and also the directory.
      Parameter:
      dir -
      goOnWithError -
      Gibt zurück:
      success
    • isEmpty

      public static final boolean isEmpty(File aDirectory)
      Parameter:
      aDirectory -
      Gibt zurück:
      if the given directory is an empty directory including sub directories.
    • deleteDirContents

      public static final boolean deleteDirContents(File dir, boolean goOnOnError)
      Deletes all the files in a directory including the sub directories files, if the given file is a directory but does not delete the directory itself.
      Parameter:
      dir -
      goOnOnError -
      Gibt zurück:
      success
    • deleteDirContents

      public static final boolean deleteDirContents(File aDir, String aExtension, long aOlderThanMillis)
      Deletes all the files in a directory including the sub directories files, if the given file is a directory but does not delete the directory itself. It only deletes files with given extension (or null for all) if last modified date is older than given long-date.
      Parameter:
      aDir -
      aExtension -
      aOlderThanMillis -
      Gibt zurück:
      success
    • getDirContents

      public static final Collection<File> getDirContents(File aDir, String aExtension, long aOlderThanMillis)
      Parameter:
      aDir -
      aExtension -
      aOlderThanMillis -
      Gibt zurück:
      Collection of Files fitting given criteria
    • getDirectoriesOnly

      public static final List<File> getDirectoriesOnly(File aDir, boolean aRecursive)
      Parameter:
      aDir -
      aRecursive -
      Gibt zurück:
      Collection of Directories in aDir
    • deleteDirContents

      public static final boolean deleteDirContents(File aDir, String aExtension)
      Deletes all the files in a directory including the sub directories files, if the given file is a directory but does not delete the directory itself.It only deletes files with given extension
      Parameter:
      aDir -
      aExtension -
      Gibt zurück:
      success
    • returnValidFilename

      public static final String returnValidFilename(String aUncheckedFilename)
      Replaces all letters that are maybe not supported by system for using in filename. You should only give the filename without path!!!
      Parameter:
      aUncheckedFilename -
      Gibt zurück:
      valid file name
    • returnValidPath

      public static final String returnValidPath(String aUncheckedFilename)
      Replaces all letters that are maybe not supported by system for using in filename. You should only give the filename without path!!! If add/remove characters also change isValidFilename/getInvalidFilenameCharacters
      Parameter:
      aUncheckedFilename -
      Gibt zurück:
      valid file name
    • isValidFilename

      public static final boolean isValidFilename(String aFilename)
      You should only give the filename without path!!! If add/remove characters also change returnValidPath/getInvalidFilenameCharacters
      Parameter:
      aFilename -
      Gibt zurück:
      if the given filename is valid
    • getInvalidFilenameCharacters

      public static final String getInvalidFilenameCharacters()
      If add/remove characters also change returnValidPath/isValidFilename
      Gibt zurück:
      a string containing all invalid characters.
    • getFileSizeString

      public static String getFileSizeString(long aByte)
      Parameter:
      aByte -
      Gibt zurück:
      a string describing the given byte size
    • getHostNameOfLocalSystem

      public static String getHostNameOfLocalSystem() throws UnknownHostException
      Gibt zurück:
      HostName of localhost.
      Löst aus:
      UnknownHostException
    • getIPOfLocalSystem

      public static String getIPOfLocalSystem() throws UnknownHostException
      Gibt zurück:
      IP of localhost.
      Löst aus:
      UnknownHostException
    • getTemporaryExecutionFilePath

      public static String getTemporaryExecutionFilePath(String aFilePath) throws IOException
      Parameter:
      aFilePath -
      Gibt zurück:
      If the File with the path is used by an other program a new one wit ~x is created and returned
      Löst aus:
      IOException
    • doesPatternFit

      public static boolean doesPatternFit(String aFileName, List<String> aPatternList, boolean aIgnoreCase)
      Parameter:
      aFileName -
      aPatternList -
      aIgnoreCase -
      Gibt zurück:
      if the given text fits to any of the given patterns.
    • doesPatternFit

      public static boolean doesPatternFit(String aFileName, String aPattern, boolean aIgnoreCase)
      Parameter:
      aFileName -
      aPattern -
      aIgnoreCase -
      Gibt zurück:
      if the given patterns fit .
    • getRelativePath

      public static String getRelativePath(File aFromDir, File aToFileOrDir) throws IOException
      Parameter:
      aFromDir -
      aToFileOrDir -
      Gibt zurück:
      the relative path. The first file is the directory, the second is the file.
      Löst aus:
      IOException
    • fillFileCollection

      public static Collection<File> fillFileCollection(File aDirectory, Collection<File> aFileCollection, boolean aIncludeDirectories)
      Parameter:
      aDirectory -
      aFileCollection -
      aIncludeDirectories -
      Gibt zurück:
      all files from the collection including dirs if wanted.
    • fillFileCollection

      public static Collection<File> fillFileCollection(File aDirectory, Collection<File> aFileCollection, String aExtensionFilter)
      Parameter:
      aDirectory -
      aFileCollection -
      aExtensionFilter -
      Gibt zurück:
      all files from the collection without directories but only with given Extension - without extension all files are returned.
    • fillFileCollection

      public static Collection<File> fillFileCollection(File aDirectory, boolean aIncludeDirectories, String aExtensionFilter)
      Parameter:
      aDirectory -
      aIncludeDirectories -
      aExtensionFilter -
      Gibt zurück:
      all files from the collection without directories but only with given Extension - without extension all files are returned.
    • getFileSize

      public static long getFileSize(File aFile, boolean aRecursive)
      Returns the size of the given file. If its a directory it will return the total size of all files in it (including the sub directories).
      Parameter:
      aFile -
      aRecursive -
      Gibt zurück:
      file size
    • getFilesWithExtension

      public static ArrayList<File> getFilesWithExtension(File aDirectory, String aExtension)
      Parameter:
      aDirectory - Directory in which too search
      aExtension - Extension to look for
      Gibt zurück:
      all files in a directory with a given extension
    • getFilesWithExtension

      public static ArrayList<File> getFilesWithExtension(File aDirectory, String aExtension, boolean aIncludeSubDirs)
      Parameter:
      aDirectory - Directory in which too search
      aExtension - Extension to look for
      aIncludeSubDirs -
      Gibt zurück:
      all files in a directory with a given extension
    • getBytesFromFile

      public static byte[] getBytesFromFile(File aFile) throws IOException
      Parameter:
      aFile -
      Gibt zurück:
      the contents of the file in a byte array.
      Löst aus:
      IOException
      IllegalArgumentException - if the file length is more than Integer.MAX_VALUE
    • isInDirectory

      public static boolean isInDirectory(File aFile, File aDirectory)
      Parameter:
      aFile -
      aDirectory -
      Gibt zurück:
      if the given file is a subfile/-directory of the given directory.
    • createLockFile

      public static boolean createLockFile(File aDirectory)
      Locks the system.
      Parameter:
      aDirectory -
      Gibt zurück:
      success
    • getFile

      public static File getFile(Collection<File> aFileCollection, String aFileName)
      Parameter:
      aFileCollection -
      aFileName -
      Gibt zurück:
      the given fileList for the also given fileName.
    • checkURL

      public static URL checkURL(String aURL)
      Parameter:
      aURL -
      Gibt zurück:
      the checked URL or null or MalformedURLException
    • chooseFile

      public static File chooseFile(String aExtension)
      Parameter:
      aExtension -
      Gibt zurück:
      the chosen file
    • doesFileExist

      public static boolean doesFileExist(String aPath, boolean aSouldAcceptDirectories)
      Parameter:
      aPath -
      aSouldAcceptDirectories -
      Gibt zurück:
      if File exists
    • readCSVtoArray

      public static String[][] readCSVtoArray(File aFile, String aDivider, boolean aIncludeHeader) throws IOException
      Parameter:
      aFile -
      aDivider -
      aIncludeHeader -
      Gibt zurück:
      the content of the CSV as Array
      Löst aus:
      IOException
    • readCSVtoArray

      public static String[][] readCSVtoArray(InputStream aInputStream, String aDivider, boolean aIncludeHeader) throws IOException
      Parameter:
      aInputStream -
      aDivider -
      aIncludeHeader -
      Gibt zurück:
      the content of the CSV as Array
      Löst aus:
      IOException
    • resizeArray

      public static Object resizeArray(Object oldArray, int newSize)
      Reallocates an array with a new size, and copies the contents of the old array to the new array.
      Parameter:
      oldArray - the old array, to be reallocated.
      newSize - the new array size.
      Gibt zurück:
      A new array with the same contents.
    • writeArrayToFile

      public static <T> void writeArrayToFile(T[][] aSumOfCutValues, File aFile, String aSeperator) throws IOException
      Typparameter:
      T -
      Parameter:
      aSumOfCutValues -
      aFile -
      aSeperator -
      Löst aus:
      IOException
    • fillWithZero

      public static <T extends Number> void fillWithZero(T[][] aValuesArray)
      Typparameter:
      T -
      Parameter:
      aValuesArray -
    • setAuthentication

      public static void setAuthentication(String aUsername, String aPassword)
      Parameter:
      aUsername - the user name to set
      aPassword - according to the user name to set
    • cleanPath

      public static String cleanPath(String aFileName)
      Parameter:
      aFileName -
      Gibt zurück:
      the cleaned path
    • hasAuthentication

      public static boolean hasAuthentication()
      Gibt zurück:
    • combineAndGZipFiles

      public static File combineAndGZipFiles(String aAbsolutePath, List<File> aFilesForPattern, int aHeaderLinesToInclude) throws IOException
      Parameter:
      aAbsolutePath -
      aFilesForPattern -
      aHeaderLinesToInclude -
      Gibt zurück:
      Löst aus:
      IOException