Exemplo n.º 1
0
  /**
   * Processes a folder and adds it to the list of existing folders.
   *
   * @param folder the folder to process
   * @return the ResourceFolder created from this folder, or null if the process failed.
   */
  @Nullable
  public ResourceFolder processFolder(@NonNull IAbstractFolder folder) {
    ensureInitialized();

    // split the name of the folder in segments.
    String[] folderSegments = folder.getName().split(SdkConstants.RES_QUALIFIER_SEP);

    // get the enum for the resource type.
    ResourceFolderType type = ResourceFolderType.getTypeByName(folderSegments[0]);

    if (type != null) {
      // get the folder configuration.
      FolderConfiguration config = FolderConfiguration.getConfig(folderSegments);

      if (config != null) {
        return add(type, config, folder);
      }
    }

    return null;
  }