This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

View | Details | Raw Unified | Return to bug 248933
Collapse All | Expand All

(-)a/openide.filesystems/apichanges.xml (+28 lines)
Lines 49-54 Link Here
49
        <apidef name="filesystems">Filesystems API</apidef>
49
        <apidef name="filesystems">Filesystems API</apidef>
50
    </apidefs>
50
    </apidefs>
51
    <changes>
51
    <changes>
52
        <change id="FileSystem.getNativeFileSeparator">
53
            <api name="filesystems"/>
54
            <summary>Native file separator for filesystem</summary>
55
            <version major="9" minor="4" />
56
            <date year="2014" month="11" day="27"/>
57
            <author login="vkvashin"/>
58
            <compatibility addition="yes" deletion="no" deprecation="no" source="compatible" binary="compatible"/>
59
            <description>
60
                <p>
61
                    New method <a href="@TOP@org/openide/filesystems/FileSystem.html#getNativeFileSeparator()">
62
                    FileSystem.getNativeFileSeparator()</a> can be used to get
63
                    file separator for underlying native file system. It is
64
                    useful when working with remote file systems which have
65
                    separators different from <code>File.separator</code>.
66
                </p>
67
                <p>
68
                    Method <a href="@TOP@org/openide/filesystems/FileUtil.html#getNativeFileSeparator(org.openide.filesystems.FileObject)">
69
                    FileUtil.getNativeFileSeparator(FileObject)</a> is convenience method
70
                    with the same purpose. It takes <code>FileObject</code> as
71
                    argument, gets its filesystem and returns the filesystem's
72
                    file separator. If some exception is encountered, it is
73
                    handled silently and default file separator is returned.
74
                </p>
75
            </description>
76
            <class package="org.openide.filesystems" name="FileSystem"/>
77
            <class package="org.openide.filesystems" name="FileUtil"/>
78
            <issue number="248933"/>
79
        </change>
52
        <change id="FileLock.closeable">
80
        <change id="FileLock.closeable">
53
            <api name="filesystems"/>
81
            <api name="filesystems"/>
54
            <summary>FileLock implements AutoCloseable</summary>
82
            <summary>FileLock implements AutoCloseable</summary>
(-)a/openide.filesystems/manifest.mf (-1 / +1 lines)
Lines 2-7 Link Here
2
OpenIDE-Module: org.openide.filesystems
2
OpenIDE-Module: org.openide.filesystems
3
OpenIDE-Module-Localizing-Bundle: org/openide/filesystems/Bundle.properties
3
OpenIDE-Module-Localizing-Bundle: org/openide/filesystems/Bundle.properties
4
OpenIDE-Module-Layer: org/openide/filesystems/resources/layer.xml
4
OpenIDE-Module-Layer: org/openide/filesystems/resources/layer.xml
5
OpenIDE-Module-Specification-Version: 9.3
5
OpenIDE-Module-Specification-Version: 9.4
6
6
7
7
(-)a/openide.filesystems/src/org/openide/filesystems/FileSystem.java (+12 lines)
Lines 50-55 Link Here
50
import java.beans.PropertyChangeSupport;
50
import java.beans.PropertyChangeSupport;
51
import java.beans.PropertyVetoException;
51
import java.beans.PropertyVetoException;
52
import java.beans.VetoableChangeListener;
52
import java.beans.VetoableChangeListener;
53
import java.io.File;
53
import java.io.IOException;
54
import java.io.IOException;
54
import java.io.Serializable;
55
import java.io.Serializable;
55
import java.net.URL;
56
import java.net.URL;
Lines 738-743 Link Here
738
        getFCLSupport().removeFileChangeListener(fcl);
739
        getFCLSupport().removeFileChangeListener(fcl);
739
    }
740
    }
740
741
742
    /**
743
     * Get file separator for underlying native file system.
744
     *
745
     * @return Native file separator, usually single slash (/) or backslash (\)
746
     * character.
747
     * @since 9.4
748
     */
749
    public String getNativeFileSeparator() {
750
        return File.separator;
751
    }
752
741
    /** A hook for JAR FS */
753
    /** A hook for JAR FS */
742
    void waitRefreshed() {
754
    void waitRefreshed() {
743
    }
755
    }
(-)a/openide.filesystems/src/org/openide/filesystems/FileUtil.java (+20 lines)
Lines 2129-2134 Link Here
2129
    }
2129
    }
2130
2130
2131
    /**
2131
    /**
2132
     * Get file separator for FileObject's underlying native file system.
2133
     *
2134
     * @param fo The FileObject.
2135
     *
2136
     * @return Native file separator, usually single slash (/) or backslash (\)
2137
     * character.
2138
     *
2139
     * @see FileSystem#getNativeFileSeparator()
2140
     * @since org.openide.filesystems/9.4
2141
     */
2142
    public static String getNativeFileSeparator(FileObject fo) {
2143
        try {
2144
            return fo.getFileSystem().getNativeFileSeparator();
2145
        } catch (FileStateInvalidException ex) {
2146
            LOG.log(Level.INFO, "Cannot get native file separator", ex);//NOI18N
2147
            return File.separator;
2148
        }
2149
    }
2150
2151
    /**
2132
     * Returns the root of the NetBeans default (system, configuration)
2152
     * Returns the root of the NetBeans default (system, configuration)
2133
     * filesystem.
2153
     * filesystem.
2134
     * @return a {@code FileObject} for the root of the NetBeans default (system, configuration)
2154
     * @return a {@code FileObject} for the root of the NetBeans default (system, configuration)

Return to bug 248933