public final class AssemblyFileUtils extends Object
Modifier and Type | Field and Description |
---|---|
static String |
LINE_ENDING_CRLF |
static String |
LINE_ENDING_DOS |
static String |
LINE_ENDING_KEEP |
static String |
LINE_ENDING_LF |
static String |
LINE_ENDING_UNIX |
static String |
LINE_ENDING_WINDOWS |
Modifier and Type | Method and Description |
---|---|
static void |
convertLineEndings(File source,
File dest,
String lineEndings,
Boolean atEndOfFile,
String encoding)
Converts the line endings of a file, writing a new file.
|
static void |
copyFile(File src,
File dst) |
static String |
getLineEndingCharacters(String lineEnding) |
static String |
makePathRelativeTo(String path,
File basedir) |
static String |
normalizePath(String path) |
static void |
unpack(File source,
File destDir,
ArchiverManager archiverManager)
Unpacks the archive file.
|
static void |
verifyTempDirectoryAvailability(File tempDir) |
public static final String LINE_ENDING_KEEP
public static final String LINE_ENDING_DOS
public static final String LINE_ENDING_WINDOWS
public static final String LINE_ENDING_UNIX
public static final String LINE_ENDING_CRLF
public static final String LINE_ENDING_LF
public static void verifyTempDirectoryAvailability(@Nonnull File tempDir)
public static void unpack(File source, File destDir, ArchiverManager archiverManager) throws ArchiveExpansionException, NoSuchArchiverException
source
- File to be unpacked.destDir
- Location where to put the unpacked files.ArchiveExpansionException
NoSuchArchiverException
public static void convertLineEndings(@Nonnull File source, @Nonnull File dest, String lineEndings, Boolean atEndOfFile, String encoding) throws IOException
source
- The source file, not nulldest
- The destination file, not nulllineEndings
- This is the result of the getLineEndingChars(..) method in this utility class; the actual
line-ending characters, not null.atEndOfFile
- The end-of-file line ending,
if true then the resulting file will have a new line at the end even if the input didn't have one,
if false then the resulting file will have no new line at the end even if the input did have one,
null to determine whether to have a new line at the end of the file based on the input fileencoding
- The encoding to use, null for platform encodingIOException
@Nullable public static String getLineEndingCharacters(@Nullable String lineEnding) throws AssemblyFormattingException
AssemblyFormattingException
public static void copyFile(File src, File dst) throws IOException
IOException
Copyright © 2002–2014 The Apache Software Foundation. All rights reserved.