com.sun.grid.installer.util
public class FileHandler extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
POS_GROUP_FIELD |
static int |
POS_NUMOFLINKS_FIELD |
static int |
POS_OWNER_FIELD |
static int |
POS_PERMISSION_FIELD |
static java.lang.String |
SEPARATOR |
Constructor and Description |
---|
FileHandler() |
Modifier and Type | Method and Description |
---|---|
static void |
generateFile(java.util.ArrayList<java.lang.String> lines,
java.lang.String filePath)
Generates file from content
|
protected static java.lang.String[] |
getFileProps(java.lang.String filePath)
Returns with the file properies supplied by the 'ls -la' command
|
static java.util.ArrayList<java.lang.String> |
readFileContent(java.lang.String filePath,
boolean keepLineFeed)
Reads file content
|
public static int POS_PERMISSION_FIELD
public static int POS_NUMOFLINKS_FIELD
public static int POS_OWNER_FIELD
public static int POS_GROUP_FIELD
public static java.lang.String SEPARATOR
public static void generateFile(java.util.ArrayList<java.lang.String> lines, java.lang.String filePath) throws java.io.IOException
lines
- The content to generate file forfilePath
- The result file pathjava.io.IOException
public static java.util.ArrayList<java.lang.String> readFileContent(java.lang.String filePath, boolean keepLineFeed) throws java.io.FileNotFoundException, java.io.IOException
filePath
- The path to the file to be readkeepLineFeed
- indicates whether the line feed ('\n') should be kept in the result.java.io.FileNotFoundException
java.io.IOException
protected static java.lang.String[] getFileProps(java.lang.String filePath)
filePath
- Path to the file whose properies should return