org.appng.api.model

## Enum ResourceType

- java.lang.Object
- - java.lang.Enum<ResourceType>
  - - org.appng.api.model.ResourceType

- All Implemented Interfaces:
    FilenameFilter, Serializable, Comparable<ResourceType>

      public enum ResourceType
      extends Enum<ResourceType>
      implements FilenameFilter

  Defines the different types of a `Resource`.
  Author:
    Matthias Herlitzius

- - ### Enum Constant Summary

    Enum Constants
    Enum Constant and Description
    `APPLICATION` The `Application`'s `application.xml` located in the root directory
    `ASSET` not yet supported
    `BEANS_XML` The `Application`'s `beans.xml` located in the root directory
    `DICTIONARY` The `Application`'s dictionaries (`*.properties`), located at `/dictionary`
    `JAR` The `Application`'s JAR files (`*.jar`) located at `/lib`
    `RESOURCE` The `Application`s custom resources, such as .js, .css, .jpg, .png
    `SQL` The `Application`s SQL scripts (`*.sql`), located at `/sql`
    `TPL` The `Application`s custom (non-XSL) template resources
    `XML` The `Application`s XML sources (`*.xml`) located at `/conf`
    `XSL` The `Application`s custom XSL stylesheets (`*.xsl`) located at `/xsl`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `APPLICATION_XML_NAME`
    `static String` | `BEANS_XML_NAME`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `accept(File dir, String name)`
    `Set<String>` | `getAllowedFileEndings()` Returns an immutable set of all allowed file-endings (without '.')
    `String` | `getFolder()` Returns the relative path for this type.
    `boolean` | `isValidFileEnding(String fileEnding)` Checks whether the given file-ending is valid for this type.
    `boolean` | `isValidFileName(String fileName)` Checks whether the given file-name is valid for this type.
    `boolean` | `supportsSubfolders()` Checks whether this type supports subfolders.
    `static ResourceType` | `valueOf(String name)` Returns the enum constant of this type with the specified name.
    `static ResourceType[]` | `values()` Returns an array containing the constants of this enum type, in the order they are declared.

    - ### Methods inherited from class java.lang.Enum

      `clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf`

    - ### Methods inherited from class java.lang.Object

      `getClass, notify, notifyAll, wait, wait, wait`

- - ### Enum Constant Detail

    - #### BEANS_XML

          public static final ResourceType BEANS_XML

      The `Application`'s `beans.xml` located in the root directory

    - #### JAR

          public static final ResourceType JAR

      The `Application`'s JAR files (`*.jar`) located at `/lib`

    - #### XML

          public static final ResourceType XML

      The `Application`s XML sources (`*.xml`) located at `/conf`

    - #### XSL

          public static final ResourceType XSL

      The `Application`s custom XSL stylesheets (`*.xsl`) located at `/xsl`

    - #### SQL

          public static final ResourceType SQL

      The `Application`s SQL scripts (`*.sql`), located at `/sql`

    - #### TPL

          public static final ResourceType TPL

      The `Application`s custom (non-XSL) template resources

    - #### RESOURCE

          public static final ResourceType RESOURCE

      The `Application`s custom resources, such as .js, .css, .jpg, .png

    - #### ASSET

          public static final ResourceType ASSET

      not yet supported

    - #### DICTIONARY

          public static final ResourceType DICTIONARY

      The `Application`'s dictionaries (`*.properties`), located at `/dictionary`

    - #### APPLICATION

          public static final ResourceType APPLICATION

      The `Application`'s `application.xml` located in the root directory

  - ### Field Detail

    - #### BEANS_XML_NAME

          public static final String BEANS_XML_NAME

      See Also:
        Constant Field Values

    - #### APPLICATION_XML_NAME

          public static final String APPLICATION_XML_NAME

      See Also:
        Constant Field Values

  - ### Method Detail

    - #### values

          public static ResourceType[] values()

      Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:

          for (ResourceType c : ResourceType.values())
              System.out.println(c);

      Returns:
        an array containing the constants of this enum type, in the order they are declared

    - #### valueOf

          public static ResourceType valueOf(String name)

      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
        `name` - the name of the enum constant to be returned.
      Returns:
        the enum constant with the specified name
      Throws:
        `IllegalArgumentException` - if this enum type has no constant with the specified name
        `NullPointerException` - if the argument is null

    - #### getFolder

          public String getFolder()

      Returns the relative path for this type.
      Returns:
        the relative path

    - #### supportsSubfolders

          public boolean supportsSubfolders()

      Checks whether this type supports subfolders.
      Returns:
        `true` if this type supports subfolder, `false` otherwise

    - #### isValidFileEnding

          public boolean isValidFileEnding(String fileEnding)

      Checks whether the given file-ending is valid for this type.
      Parameters:
        `fileEnding` - a file-ending, without '.'
      Returns:
        `true` if the given file-ending is valid for this type, `false` otherwise

    - #### isValidFileName

          public boolean isValidFileName(String fileName)

      Checks whether the given file-name is valid for this type.
      Parameters:
        `fileName` - the name of the file
      Returns:
        `true` if the given file-name is valid for this type, `false` otherwise

    - #### getAllowedFileEndings

          public Set<String> getAllowedFileEndings()

      Returns an immutable set of all allowed file-endings (without '.')
      Returns:
        a set of all allowed file-endings. An empty set means all file types are allowed.

    - #### accept

          public boolean accept(File dir,
                                String name)

      Specified by:
        `accept` in interface `FilenameFilter`

Copyright © 2011–2023 aiticon GmbH. All rights reserved.