Class FileTool
java.lang.Object
com.tunyk.mvn.plugins.htmlcompressor.FileTool
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
getElapsedHMSTime
(long elapsedTime) Gets the elapsed HMS time.Gets the file encoding.String[]
Gets the file extensions.getFiles()
Gets the files.Gets the root dir path.static String
humanReadableByteCount
(long bytes, boolean systemOfUnits) Human readable byte count.boolean
Checks if is recursive.void
setFileEncoding
(Charset fileEncoding) Sets the file encoding.void
setFileExtensions
(String[] fileExtensions) Sets the file extensions.void
setRecursive
(boolean recursive) Sets the recursive.void
setRootDirPath
(String rootDirPath) Sets the root dir path.void
writeFiles
(Map<String, String> map, String targetDir) Write files.void
Write to json file.
-
Field Details
-
rootDirPath
The root dir path. -
fileExtensions
The file extensions. -
recursive
private boolean recursiveThe recursive. -
fileEncoding
The file encoding.
-
-
Constructor Details
-
FileTool
Instantiates a new file tool.- Parameters:
rootDir
- the root dirfileExtensions
- the file extrecursive
- the recursive- Throws:
IOException
- Signals that an I/O exception has occurred.
-
-
Method Details
-
getFiles
Gets the files.- Returns:
- the files
- Throws:
IOException
- Signals that an I/O exception has occurred.
-
writeFiles
Write files.- Parameters:
map
- the maptargetDir
- the target dir- Throws:
IOException
- Signals that an I/O exception has occurred.
-
writeToJsonFile
public void writeToJsonFile(Map<String, String> map, String targetFile, String integrationCode) throws IOException, org.json.JSONExceptionWrite to json file.- Parameters:
map
- the maptargetFile
- the target fileintegrationCode
- the integration code- Throws:
IOException
- Signals that an I/O exception has occurred.org.json.JSONException
- the JSON exception
-
humanReadableByteCount
Human readable byte count.- Parameters:
bytes
- the bytessystemOfUnits
- the systemOfUnits- Returns:
- the string
-
getElapsedHMSTime
Gets the elapsed HMS time.- Parameters:
elapsedTime
- the elapsed time- Returns:
- the elapsed HMS time
-
getRootDirPath
-
setRootDirPath
Sets the root dir path.- Parameters:
rootDirPath
- the new root dir path- Throws:
IOException
- Signals that an I/O exception has occurred.
-
getFileExtensions
-
setFileExtensions
Sets the file extensions.- Parameters:
fileExtensions
- the new file extensions
-
isRecursive
public boolean isRecursive()Checks if is recursive.- Returns:
- true, if is recursive
-
setRecursive
public void setRecursive(boolean recursive) Sets the recursive.- Parameters:
recursive
- the new recursive
-
getFileEncoding
-
setFileEncoding
Sets the file encoding.- Parameters:
fileEncoding
- the new file encoding
-