Package org.jruby.util

Examples of org.jruby.util.FileResource.absolutePath()


            // (they are always zero), so we use canonical paths instead. (JRUBY-5726)
            // If we can't load a native POSIX, use this same logic. (JRUBY-6982)
            if (file1.exists() && file2.exists()) {
                try {
                    String canon1 = new File(file1.absolutePath()).getCanonicalPath();
                    String canon2 = new File(file2.absolutePath()).getCanonicalPath();
                    return runtime.newBoolean(canon1.equals(canon2));
                } catch (IOException canonicalizationError) {
                    return runtime.getFalse();
                }
            } else {
View Full Code Here


        RubyFileStat stat = null;
        if (!(filename instanceof RubyFile)) {
            RubyString path = get_path(context, filename);
            FileResource file = JRubyFile.createResource(runtime.getPosix(), runtime.getCurrentDirectory(), path.getUnicodeValue());
            if (file.exists()) {
                stat = runtime.newFileStat(file.absolutePath(), false);
            }
        } else {
            stat = (RubyFileStat) ((RubyFile) filename).stat(context);
        }
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.