Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package org.jboss.windup.rules.apps.java.util;
 
 import  org.jboss.windup.graph.model.resource.FileModel;
 import  org.jboss.windup.reporting.SourceTypeResolver;
Resolves java-related sources to their type for reporting purposes.

Author(s):
Jesse Sightler
public class JavaSourceTypeResolver implements SourceTypeResolver
    @Override
    public String resolveSourceType(FileModel f)
    {
        String filename = f.getFileName();
        if (filename.endsWith(".properties"))
        {
            return "properties";
        }
        else if (filename.equalsIgnoreCase("MANIFEST.MF"))
        {
            return "manifest";
        }
        else if (f instanceof JarManifestModel)
        {
            return "manifest";
        }
        else if (f instanceof JavaSourceFileModel)
        {
            return "java";
        }
        else
        {
            return null;
        }
    }
New to GrepCode? Check out our FAQ X