File tree Expand file tree Collapse file tree
src/main/java/org/apache/commons/io Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -124,12 +124,17 @@ public enum FileSystem {
124124 */
125125 private static final boolean IS_OS_WINDOWS = getOsMatchesName (OS_NAME_WINDOWS_PREFIX );
126126
127+ /**
128+ * The current FileSystem.
129+ */
130+ private static final FileSystem CURRENT = current ();
131+
127132 /**
128133 * Gets the current file system.
129134 *
130135 * @return the current file system
131136 */
132- public static FileSystem getCurrent () {
137+ private static FileSystem current () {
133138 if (IS_OS_LINUX ) {
134139 return LINUX ;
135140 }
@@ -142,6 +147,15 @@ public static FileSystem getCurrent() {
142147 return GENERIC ;
143148 }
144149
150+ /**
151+ * Gets the current file system.
152+ *
153+ * @return the current file system
154+ */
155+ public static FileSystem getCurrent () {
156+ return CURRENT ;
157+ }
158+
145159 /**
146160 * Decides if the operating system matches.
147161 *
You can’t perform that action at this time.
0 commit comments