Package com.helger.as2lib.util
Class AS2IOHelper
- java.lang.Object
-
- com.helger.as2lib.util.AS2IOHelper
-
@Immutable public final class AS2IOHelper extends Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static byte[]getAllAsciiBytes(String sString)static InputStreamgetContentTransferEncodingAwareInputStream(InputStream aIS, String sEncoding)static OutputStreamgetContentTransferEncodingAwareOutputStream(OutputStream aOS, String sEncoding)static FilegetDirectoryFile(String sDirectory)static StringgetFilenameFromMessageID(String sMessageID)static com.helger.commons.io.file.FileOperationManagergetFileOperationManager()static StringgetSafeFileAndFolderName(String s)static StringgetTransferRate(long nBytes, com.helger.commons.timing.StopWatch aSW)static FilegetUniqueFile(File aDir, String sFilename)static voidhandleError(File aFile, String sErrorDirectory, String sTargetFilename)move the file to an error directorystatic FilemoveFile(File aSrc, File aDestFile, boolean bOverwrite, boolean bRename)
-
-
-
Method Detail
-
getFileOperationManager
@Nonnull public static com.helger.commons.io.file.FileOperationManager getFileOperationManager()
-
getTransferRate
@Nonnull @Nonempty public static String getTransferRate(long nBytes, @Nonnull com.helger.commons.timing.StopWatch aSW)
-
getUniqueFile
@Nonnull public static File getUniqueFile(@Nonnull File aDir, @Nullable String sFilename)
-
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
@Nullable public static String getFilenameFromMessageID(@Nonnull String sMessageID)
-
getSafeFileAndFolderName
@Nullable public static String getSafeFileAndFolderName(@Nullable String s)
-
getAllAsciiBytes
@Nonnull @ReturnsMutableCopy public static byte[] getAllAsciiBytes(@Nonnull String sString)
-
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
-
-