Package java.io

Examples of java.io.File.toURI()


         
          File  file = input.getFile();
         
          if ( file.exists() && file.length() == input.getLength()){
           
            source_url = file.toURI().toURL();
          }
        }
       
        if ( source_url == null ){
       
View Full Code Here


            } else {
                String path = m_rootPath;
                File pathfile = new File(path);
                if (pathfile.exists()) {
                    m_schemaDir = pathfile;
                    m_schemaRoot = pathfile.toURI().toURL();
                } else {
                    if (!path.endsWith("/")) {
                        path += '/';
                    }
                    m_schemaRoot = new URL(path);
View Full Code Here

                String path = m_rootPath;
                File pathfile = new File(path).getCanonicalFile();
                if (pathfile.exists()) {
                    if (pathfile.isDirectory()) {
                        m_schemaDir = pathfile;
                        m_schemaRoot = pathfile.toURI().toURL();
                    } else {
                        System.out.println("Schema root path '" + m_rootPath + "' must be a directory");
                        alist.setValid(false);
                    }
                } else {
View Full Code Here

                        File file = null;
                        if (ClasspathUrlExtender.isClasspathUrl(path)) {
                            url = ClasspathUrlExtender.buildURL(null, path);
                        } else {
                            file = new File(path);
                            url = file.toURI().toURL();
                        }
                        try {
                            BindingElement binding = processPregeneratedBinding(url, elemmap, typemap, handler);
                            if (!usenns) {
                                usenns = checkNoNamespace(binding);
View Full Code Here

       
        // validate the root binding (which will pull in all referenced bindings)
        File file = new File(dir, root.getFileName());
        ValidationContext vctx = new ValidationContext(loc);
        FileInputStream is = new FileInputStream(file);
        BindingElement binding = BindingElement.validateBinding(root.getFileName(), file.toURI().toURL(), is, vctx);
        if (binding == null || vctx.getErrorCount() > 0 || vctx.getFatalCount() > 0) {
            return null;
        } else {
           
            // build and return list of validated binding definitions
View Full Code Here

                        errors.add("No files found matching command line pattern '" + pattern +
                            "' in directory " + dir.getAbsolutePath());
                    } else {
                        for (int i = 0; i < matches.length; i++) {
                            String match = matches[i];
                            report.foundMatch(match, new URL(dir.toURI().toURL(), match));
                        }
                    }
                }
            } else {
               
View Full Code Here

                    File file = new File(path);
                    if (!file.isAbsolute()) {
                        file = new File(basedir, path);
                    }
                    if (file.exists()) {
                        report.foundMatch(path, file.toURI().toURL());
                        continue;
                    }
                }
               
                // build URL, with support for classpath protocol
View Full Code Here

                            {
                                ResourceWriter.instance().writeStringToFile(
                                    outputString,
                                    outputFile,
                                    this.getNamespace());
                                AndroMDALogger.info("Output: '" + outputFile.toURI() + "'");
                            }
                            else
                            {
                                if (this.getLogger().isDebugEnabled())
                                {
View Full Code Here

                            }
                            else
                            {
                                if (this.getLogger().isDebugEnabled())
                                {
                                    this.getLogger().debug("Empty Output: '" + outputFile.toURI() + "' --> not writing");
                                }
                            }
                            AndroMDALogger.reset();
                        }
                    }
View Full Code Here

                        if (!outputFile.exists() || resource.isOverwrite())
                        {
                            ResourceWriter.instance().writeUrlToFile(
                                resourceUrl,
                                outputFile.toString());
                            AndroMDALogger.info("Output: '" + outputFile.toURI() + "'");
                        }
                    }
                }
            }
        }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.