Overview | Package | Class | Use | Tree | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.togethersoft.openapi.util
Class ResourceUtil

public class ResourceUtil

Presents utilites to retrieve some information for specified `Class`. For example : class name, package name, class path an so on.

Author:
  TogetherSoft

Method Summary
`static String` | `getModuleHomeDirectory(Class moduleClass)`
`static String` | `getPackageName(Class clazz)` Detects package name without class name.
`static File` | `getResource(Class context, String path)` Combines `convertToFile` with `Class.findResource()` and contains workarounds to some known `findResource()` bugs
`static File` | `getResourceRoot(Class context, String path)` Attempts to detect classpath entry which contains given resource
`static String` | `getShortName(Class clazz)` Detects class name without package specification (short name).

Method Detail

### getModuleHomeDirectory

    public static String getModuleHomeDirectory(Class moduleClass)

### getPackageName

    public static String getPackageName(Class clazz)

  Detects package name without class name.
  Returns: Package name if detected, otherwise empty `String`.

### getResource

    public static File getResource(Class context, String path)

  Combines `convertToFile` with `Class.findResource()` and contains workarounds to some known `findResource()` bugs
  See Also:
    java.lang.Class#findResource, #convertToFile

### getResourceRoot

    public static File getResourceRoot(Class context, String path)

  Attempts to detect classpath entry which contains given resource

### getShortName

    public static String getShortName(Class clazz)

  Detects class name without package specification (short name).
  Returns: Short name or full name if package not specified.

Association Links

to Class java.lang.String

to Class java.lang.String

to Class java.lang.String

to Class java.lang.String

to Class java.lang.String

to Class java.lang.String

to Class java.lang.String

to Class java.lang.String

Overview | Package | Class | Use | Tree | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD