Package java.nio.file

Examples of java.nio.file.FileSystem


    @Specialization
    @SlowPath
    protected Object libPathsVec(RAbstractStringVector pathVec) {
        controlVisibility();
        ArrayList<String> resultsList = new ArrayList<>(pathVec.getLength());
        FileSystem fileSystem = FileSystems.getDefault();
        for (int i = 0; i < resultsList.size(); i++) {
            String path = Utils.tildeExpand(pathVec.getDataAt(i));
            try {
                resultsList.add(fileSystem.getPath(path).toRealPath().toString());
            } catch (IOException e) {
                // directory does not exist (or is inaccessible - same thing),
                // just ignore it
            }
        }
View Full Code Here


        return com.google.common.io.Files.hash(file, Hashing.md5()).toString();
    }

    private SourceHash parse(String str) {
        Iterator<String> parts = Splitter.on("**").split(str).iterator();
        FileSystem fileSystem = FileSystems.getDefault();
        return new SourceHash(
                SourcePath.valueOf(fileSystem.getPath(parts.next()),
                               fileSystem.getPath(parts.next())),
                parts.next(),
                Long.parseLong(parts.next())
        );
    }
View Full Code Here

            }
        }
       
        if(bean.getHelp())
            usage(clp);
        FileSystem fSystem = FileSystems.getDefault();
        boolean specParsed = false;
        ASTSpecWalker walker = new ASTSpecWalker();
        if(bean.printSchema()){
            String inputFile = bean.getSpecInputFile();
           
            try {
                if(clangAST.Driver.parseSpecFile(inputFile) != 0)
                        System.exit(1);
            } catch (IOException ex) {
                System.err.println(ex.getMessage());
                System.exit(1);
            }
           
            String outputFile = table.getClangSpecName() + ".logic";
            Path outputPath = fSystem.getPath(outputFile);
           
            try (BufferedWriter writer = Files.newBufferedWriter(outputPath, StandardCharsets.UTF_8);){
               
                walker.walk(new PrintLogicQLSchema(writer));
                specParsed = true;
            }
            catch(IOException ex){
                System.err.println(ex.getMessage());
                System.exit(1);
            }
        }
       
        if(bean.createPlugin()){
            try {
                if(!specParsed){
                    if(clangAST.Driver.parseSpecAndAuxFile(bean.getSpecInputFile(), bean.getAuxInputFile()) != 0)
                        System.exit(1);
                }
                else {
                    if(clangAST.Driver.parseAuxFile(bean.getAuxInputFile()) != 0)
                        System.exit(1);
                }
               
                String outputFilename = table.getClangSpecName() + ".h";
                Path outputFile = fSystem.getPath(outputFilename);
               
                try(BufferedWriter writer = Files.newBufferedWriter(outputFile, StandardCharsets.UTF_8);){
                    walker.walk(new PrintClangCsvPlugin(writer));
                }

            } catch (IOException ex) {
                System.err.println(ex.getMessage());
                System.exit(1);
            }
        }
       
        if(bean.genImportCode()){
            try{
                if(!specParsed){
                    if(clangAST.Driver.parseSpecFile(bean.getSpecInputFile()) != 0)
                        System.exit(1);
                }
               
                String outputFilename = table.getClangSpecName() + "-import.logic";
                Path outputFile = fSystem.getPath(outputFilename);
               
                try(BufferedWriter writer = Files.newBufferedWriter(outputFile, StandardCharsets.UTF_8);){
                    Path csvOutDir = bean.getCsvOutDir();
                    if(Files.exists(csvOutDir)){
                        if(!Files.isDirectory(csvOutDir)){
View Full Code Here

TOP

Related Classes of java.nio.file.FileSystem

Copyright © 2018 www.massapicom. 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.