code: public static void loadResource(final String serializerId,
        @SuppressWarnings("rawtypes") final Map<String, ArtifactSerializer> artifactSerializers,
        final String resourcePath, final Map<String, Object> resources) {
  
      final File resourceFile = new File(resourcePath);
      if (resourceFile != null) {
        final String resourceId = IOUtils
            .normalizeLexiconName(resourceFile.getName());
        final ArtifactSerializer<?> serializer = artifactSerializers
            .get(serializerId);
        final InputStream resourceIn = IOUtils.openFromFile(resourceFile);
        try {
          resources.put(resourceId, serializer.create(resourceIn));
        } catch (final InvalidFormatException e) {
          e.printStackTrace();
        } catch (final IOException e) {
          e.printStackTrace();
        } finally {
          try {
            resourceIn.close();
          } catch (final IOException e) {
          }
        }
      }
    }
docs: Load a resource by resourceId.
  
  @param serializerId
  the serializer id
  @param artifactSerializers
  the serializers in which to put the resource
  @param resourcePath
  the canonical path of the resource
  @param resources
  the map in which to put the resource