private File mapFile()

in cxf-xjc-plugin/src/main/java/org/apache/cxf/maven_plugin/XJCErrorListener.java [72:101]


    private File mapFile(String s) {
        File file = null;
        if (s != null && s.startsWith("file:")) {
            if (s.contains("#")) {
                s = s.substring(0, s.indexOf('#'));
            }
            try {
                URI uri = new URI(s);
                file = new File(uri);
            } catch (URISyntaxException e) {
                //ignore
            }
        }
        if (file == null) {
            //Cannot pass a null into buildContext.addMessage.  Create a pointless
            //File object that maps to the systemId
            if (s == null) {
                file = new File("null");
            } else {
                final String s2 = s;
                file = new File(s2) {
                    private static final long serialVersionUID = 1L;
                    public String getAbsolutePath() {
                        return s2;
                    }
                };
            }
        }                     
        return file;
    }