java.lang.Object
uk.autores.handling.ResourceFiling
Utility type for working with
Filer
.
Sample usage:
Filer filer = ...;
String annotationPackage = "foo.bar";
String resourcePath = "/META-INF/foo.txt";
String pkg = ResourceFiling.pkg(annotationPackage, resourcePath);
String relativeName = ResourceFiling.relativeName(resourcePath);
FileObject fo = filer.getResource(location, pkg, relativeName);
-
Method Summary
Modifier and TypeMethodDescriptionstatic CharSequence
pkg
(CharSequence annotationPackage, CharSequence resourcePath) Resolves the package string to be passed toFiler.getResource(JavaFileManager.Location, CharSequence, CharSequence)
.static CharSequence
relativeName
(CharSequence resourcePath) Resolves the relative name to be passed toFiler.getResource(JavaFileManager.Location, CharSequence, CharSequence)
.
-
Method Details
-
pkg
Resolves the package string to be passed toFiler.getResource(JavaFileManager.Location, CharSequence, CharSequence)
.- Parameters:
annotationPackage
- the annotated packageresourcePath
- non-empty resource path- Returns:
- the package to use in the filer
-
relativeName
Resolves the relative name to be passed toFiler.getResource(JavaFileManager.Location, CharSequence, CharSequence)
.- Parameters:
resourcePath
- non-empty resource path as specified in annotation- Returns:
- the resource name to use in the filer
-