private static Metadata getMetadata(String name) {
        Metadata metadata = new Metadata();
        if (name != null && name.length() > 0) {
            metadata.set(TikaCoreProperties.RESOURCE_NAME_KEY, name);
        }
        return metadata;
    }
Utility method that returns a {@link Metadata} instance
for a document with the given name.

@param name resource name (or <code>null</code>)
@return metadata instance
tika-core/src/main/java/org/apache/tika/parser/ParsingReader.java