Package com.helger.as2lib.util
Class AS2IOHelper
java.lang.Object
com.helger.as2lib.util.AS2IOHelper
-
Method Summary
Modifier and TypeMethodDescriptionstatic byte[]
getAllAsciiBytes
(String sString) static InputStream
getContentTransferEncodingAwareInputStream
(InputStream aIS, String sEncoding) static OutputStream
getContentTransferEncodingAwareOutputStream
(OutputStream aOS, String sEncoding) static File
getDirectoryFile
(String sDirectory) static String
getFilenameFromMessageID
(String sMessageID) static com.helger.commons.io.file.FileOperationManager
static String
static String
getTransferRate
(long nBytes, com.helger.commons.timing.StopWatch aSW) static File
getUniqueFile
(File aDir, String sFilename) static void
handleError
(File aFile, String sErrorDirectory, String sTargetFilename) move the file to an error directorystatic File
-
Method Details
-
getFileOperationManager
-
getDirectoryFile
-
getTransferRate
-
getUniqueFile
-
handleError
public static void handleError(@Nonnull File aFile, @Nonnull String sErrorDirectory, @Nonnull @Nonempty String sTargetFilename) throws AS2Exception move the file to an error directory- Parameters:
aFile
- Source file to movesErrorDirectory
- Error directory path.sTargetFilename
- The filename in the error directory.- Throws:
AS2Exception
- In case moving failed
-
moveFile
@Nonnull public static File moveFile(@Nonnull File aSrc, @Nonnull File aDestFile, boolean bOverwrite, boolean bRename) throws IOException - Throws:
IOException
-
getFilenameFromMessageID
-
getSafeFileAndFolderName
-
getAllAsciiBytes
-
getContentTransferEncodingAwareOutputStream
@Nonnull public static OutputStream getContentTransferEncodingAwareOutputStream(@Nonnull OutputStream aOS, @Nullable String sEncoding) throws jakarta.mail.MessagingException - Throws:
jakarta.mail.MessagingException
-
getContentTransferEncodingAwareInputStream
@Nonnull public static InputStream getContentTransferEncodingAwareInputStream(@Nonnull InputStream aIS, @Nullable String sEncoding) throws jakarta.mail.MessagingException - Throws:
jakarta.mail.MessagingException
-