public final class PreprocessorUtils extends Object
Modifier and Type | Method and Description |
---|---|
static void |
copyFile(File source,
File dest,
boolean copyFileAttributes) |
static void |
copyFileAttributes(File from,
File to) |
static String |
extractTail(String prefix,
String value) |
static String |
extractTrimmedTail(String prefix,
String value) |
static String |
generateStringForChar(char chr,
int length) |
static String |
getFileExtension(File file) |
static String |
getFilePath(File file) |
static String |
getNextLineCodes() |
static boolean |
isFileContentEquals(File src,
File dst) |
static String |
leftTrim(String rawString) |
static BufferedReader |
makeFileReader(File file,
String charset,
int bufferSize) |
static String |
normalizeVariableName(String name) |
static String |
processMacroses(String processingString,
PreprocessorContext context) |
static byte[] |
readFileAsByteArray(File file) |
static String[] |
readWholeTextFileIntoArray(File file,
String encoding,
AtomicBoolean endedByNextLine) |
static String[] |
replaceChar(String[] source,
char toBeReplaced,
char replacement) |
static String |
replacePartByChar(String text,
char chr,
int startPosition,
int length) |
static String[] |
replaceStringPrefix(String[] allowedPrefixesToBeReplaced,
String replacement,
String[] strings) |
static String[] |
splitExtensionCommaList(String extensions) |
static String[] |
splitForChar(String string,
char delimiter) |
static String[] |
splitForCharAndHoldEmptyLine(String string,
char delimiter) |
static String[] |
splitForEqualChar(String string) |
static void |
throwPreprocessorException(String msg,
String processingString,
File srcFile,
int nextStringIndex,
Throwable cause) |
public static final String LINE_END
@MustNotContainNull @ThrowsRuntimeException(value=java.lang.NullPointerException.class, reference="if extensions are null") public static String[] splitExtensionCommaList(String extensions)
public static BufferedReader makeFileReader(File file, String charset, int bufferSize) throws IOException
IOException
@MustNotContainNull public static String[] replaceChar(@MustNotContainNull String[] source, char toBeReplaced, char replacement)
public static void copyFile(File source, File dest, boolean copyFileAttributes) throws IOException
IOException
public static String replacePartByChar(String text, char chr, int startPosition, int length)
public static String generateStringForChar(char chr, int length)
public static String processMacroses(String processingString, PreprocessorContext context)
@MustNotContainNull public static String[] readWholeTextFileIntoArray(File file, String encoding, AtomicBoolean endedByNextLine) throws IOException
IOException
public static byte[] readFileAsByteArray(File file) throws IOException
IOException
@MustNotContainNull public static String[] splitForEqualChar(String string)
@MustNotContainNull public static String[] splitForCharAndHoldEmptyLine(String string, char delimiter)
@MustNotContainNull public static String[] splitForChar(String string, char delimiter)
public static void throwPreprocessorException(String msg, String processingString, File srcFile, int nextStringIndex, Throwable cause)
@MustNotContainNull public static String[] replaceStringPrefix(@MustNotContainNull String[] allowedPrefixesToBeReplaced, String replacement, @MustNotContainNull String[] strings)
public static String getNextLineCodes()
public static boolean isFileContentEquals(File src, File dst) throws IOException
IOException
Copyright © 2011–2021 Igor Maznitsa. All rights reserved.