Class PathUtilities
java.lang.Object
ml.karmaconfigs.api.common.utils.file.PathUtilities
Karma file utilities
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidCreate a filestatic voidcreateWithException(@NotNull Path file)Create a file and catch any exceptionstatic booleancreateWithResults(@NotNull Path file)Create a file and return if the file could be createdstatic voidDeletes a filestatic voiddestroyWithException(@NotNull Path file)Deletes a file and catch any exceptionstatic booleandestroyWithResults(@NotNull Path file)Deletes a file and return if the file could be createdstatic StringgetExtension(@NotNull Path file)Get the file extensionstatic PathgetFixedPath(@NotNull Path file)Fix a filestatic StringGet the file namestatic StringgetParentPath(@NotNull Path file)Get if the file is a valid filestatic StringgetParentPath(@NotNull Path file, char barReplace)Get the parent file replacing %20 ( space char )static StringGet the file replacing the %20 ( space char )static StringGet the file pathstatic StringgetPathCompleteType(Path file)Get the file complete typestatic StringgetPathType(Path file)Get the file typestatic StringgetPrettyFile(Path file)Get the pretty file pathstatic StringgetPrettyParentPath(@NotNull Path file)Get the pretty filestatic PathGet the project parent folderstatic PathgetProjectPath(String delimiter)Get the project folderstatic PathgetProjectPath(KarmaSource source)Deprecated.static PathgetSourcePath(KarmaSource source)Get the karma source jar filestatic booleanisKarmaPath(Path file)Get if the file is a karma filestatic booleanisValidPath(Path path)Get if the file is validreadAllLines(Path file)Read all the file lines
-
Constructor Details
-
PathUtilities
public PathUtilities()
-
-
Method Details
-
create
Create a file- Parameters:
file- the file to create
-
createWithException
Create a file and catch any exception- Parameters:
file- the file to create- Throws:
IOException- any exception
-
createWithResults
Create a file and return if the file could be created- Parameters:
file- the file to create- Returns:
- if the file could be created
-
destroy
Deletes a file- Parameters:
file- the path to delete
-
destroyWithException
Deletes a file and catch any exception- Parameters:
file- the path to delete- Throws:
IOException- any exception
-
destroyWithResults
Deletes a file and return if the file could be created- Parameters:
file- the path to delete- Returns:
- if the file could be created
-
isKarmaPath
Get if the file is a karma file- Parameters:
file- the file- Returns:
- if the file is a karma file
-
isValidPath
Get if the file is valid- Parameters:
path- the file- Returns:
- if the file is a valid file
-
getParentPath
Get if the file is a valid file- Parameters:
file- the file- Returns:
- if the file is a valid file
-
getPath
Get the file path- Parameters:
file- the file path- Returns:
- the file path
-
getPrettyParentPath
Get the pretty file- Parameters:
file- the file- Returns:
- the pretty file
-
getPrettyFile
Get the pretty file path- Parameters:
file- the file- Returns:
- the pretty file path
-
getParentPath
Get the parent file replacing %20 ( space char )- Parameters:
file- the filebarReplace- the %20 replace- Returns:
- the parent file
-
getPath
Get the file replacing the %20 ( space char )- Parameters:
file- the filebarReplace- the %20 replace- Returns:
- the file
-
getExtension
Get the file extension- Parameters:
file- the file- Returns:
- the file extension
-
getName
Get the file name- Parameters:
file- the file nameextension- include extension- Returns:
- the file name
-
getPathType
Get the file type- Parameters:
file- the file tpy- Returns:
- the file type
-
getPathCompleteType
Get the file complete type- Parameters:
file- the file complete type- Returns:
- the file type
-
readAllLines
Read all the file lines- Parameters:
file- the file- Returns:
- all the file lines
-
getSourcePath
Get the karma source jar file- Parameters:
source- the karma source- Returns:
- the source jar file
-
getFixedPath
Fix a file- Parameters:
file- the file- Returns:
- the fixed file
-
getProjectPath
Get the project folder- Parameters:
delimiter- the project complete path delimiter- Returns:
- the project folder
-
getProjectParent
Get the project parent folder- Returns:
- the project parent folder
-
getProjectPath
Deprecated.UseKarmaSource.getDataPath()insteadGet the project folder- Parameters:
source- the source- Returns:
- the project folder
-
KarmaSource.getDataPath()instead