Package com.google.common.reflect
Class ClassPath.ResourceInfo
- java.lang.Object
- 
- com.google.common.reflect.ClassPath.ResourceInfo
 
- 
- Direct Known Subclasses:
- ClassPath.ClassInfo
 - Enclosing class:
- ClassPath
 
 public static class ClassPath.ResourceInfo extends java.lang.Object Represents a class path resource that can be either a class file or any other resource file loadable from the class path.- Since:
- 14.0
 
- 
- 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description ByteSourceasByteSource()Returns aByteSourceview of the resource from which its bytes can be read.CharSourceasCharSource(java.nio.charset.Charset charset)Returns aCharSourceview of the resource from which its bytes can be read as characters decoded with the givencharset.booleanequals(java.lang.Object obj)java.lang.StringgetResourceName()Returns the fully qualified name of the resource.inthashCode()java.lang.StringtoString()java.net.URLurl()Returns the url identifying the resource.
 
- 
- 
- 
Method Detail- 
urlpublic final java.net.URL url() Returns the url identifying the resource.See ClassLoader.getResource(java.lang.String)- Throws:
- java.util.NoSuchElementException- if the resource cannot be loaded through the class loader, despite physically existing in the class path.
 
 - 
asByteSourcepublic final ByteSource asByteSource() Returns aByteSourceview of the resource from which its bytes can be read.- Throws:
- java.util.NoSuchElementException- if the resource cannot be loaded through the class loader, despite physically existing in the class path.
- Since:
- 20.0
 
 - 
asCharSourcepublic final CharSource asCharSource(java.nio.charset.Charset charset) Returns aCharSourceview of the resource from which its bytes can be read as characters decoded with the givencharset.- Throws:
- java.util.NoSuchElementException- if the resource cannot be loaded through the class loader, despite physically existing in the class path.
- Since:
- 20.0
 
 - 
getResourceNamepublic final java.lang.String getResourceName() Returns the fully qualified name of the resource. Such as "com/mycomp/foo/bar.txt".
 - 
hashCodepublic int hashCode() - Overrides:
- hashCodein class- java.lang.Object
 
 - 
equalspublic boolean equals(@CheckForNull java.lang.Object obj) - Overrides:
- equalsin class- java.lang.Object
 
 - 
toStringpublic java.lang.String toString() - Overrides:
- toStringin class- java.lang.Object
 
 
- 
 
-