Package org.codelibs.maven.yuicompressor
Class SourceFile
java.lang.Object
org.codelibs.maven.yuicompressor.SourceFile
Represents a source file with its source and destination roots.
Handles file path resolution and destination file creation.
-
Constructor Summary
ConstructorsConstructorDescriptionSourceFile(File srcRoot, File destRoot, String name, boolean destAsSource) Creates a new SourceFile instance. -
Method Summary
Modifier and TypeMethodDescriptionReturns the file extension including the dot.toDestFile(String suffix) Creates a destination file with the given suffix.toFile()Returns the source file.
-
Constructor Details
-
SourceFile
Creates a new SourceFile instance.- Parameters:
srcRoot- the source root directorydestRoot- the destination root directoryname- the relative file namedestAsSource- whether to use destination as source if available- Throws:
IllegalArgumentException- if any required parameter is null or invalid
-
-
Method Details
-
toFile
Returns the source file. If destAsSource is true and destination file exists, returns the destination file instead.- Returns:
- the file to be used as source
-
toDestFile
Creates a destination file with the given suffix.- Parameters:
suffix- the suffix to append before the extension- Returns:
- the destination file
-
getExtension
Returns the file extension including the dot.- Returns:
- the file extension (e.g., ".js", ".css") or empty string if no extension
-