1
1
/*
2
- * Copyright 2002-2017 the original author or authors.
2
+ * Copyright 2002-2018 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
30
30
/**
31
31
* Utility for detecting and accessing JBoss VFS in the classpath.
32
32
*
33
- * <p>As of Spring 4.0, this class supports VFS 3.x on JBoss AS 6+ (package
34
- * {@code org.jboss.vfs}) and is in particular compatible with JBoss AS 7 and
35
- * WildFly 8.
33
+ * <p>As of Spring 4.0, this class supports VFS 3.x on JBoss AS 6+
34
+ * (package {@code org.jboss.vfs}) and is in particular compatible with
35
+ * JBoss AS 7 and WildFly 8+ .
36
36
*
37
37
* <p>Thanks go to Marius Bogoevici for the initial patch.
38
38
* <b>Note:</b> This is an internal class and should not be used outside the framework.
@@ -57,13 +57,13 @@ public abstract class VfsUtils {
57
57
private static final Method VIRTUAL_FILE_METHOD_TO_URI ;
58
58
private static final Method VIRTUAL_FILE_METHOD_GET_NAME ;
59
59
private static final Method VIRTUAL_FILE_METHOD_GET_PATH_NAME ;
60
+ private static final Method VIRTUAL_FILE_METHOD_GET_PHYSICAL_FILE ;
60
61
private static final Method VIRTUAL_FILE_METHOD_GET_CHILD ;
61
62
62
63
protected static final Class <?> VIRTUAL_FILE_VISITOR_INTERFACE ;
63
64
protected static final Method VIRTUAL_FILE_METHOD_VISIT ;
64
65
65
66
private static final Field VISITOR_ATTRIBUTES_FIELD_RECURSE ;
66
- private static final Method GET_PHYSICAL_FILE ;
67
67
68
68
static {
69
69
ClassLoader loader = VfsUtils .class .getClassLoader ();
@@ -81,7 +81,7 @@ public abstract class VfsUtils {
81
81
VIRTUAL_FILE_METHOD_TO_URL = ReflectionUtils .findMethod (virtualFile , "toURL" );
82
82
VIRTUAL_FILE_METHOD_GET_NAME = ReflectionUtils .findMethod (virtualFile , "getName" );
83
83
VIRTUAL_FILE_METHOD_GET_PATH_NAME = ReflectionUtils .findMethod (virtualFile , "getPathName" );
84
- GET_PHYSICAL_FILE = ReflectionUtils .findMethod (virtualFile , "getPhysicalFile" );
84
+ VIRTUAL_FILE_METHOD_GET_PHYSICAL_FILE = ReflectionUtils .findMethod (virtualFile , "getPhysicalFile" );
85
85
VIRTUAL_FILE_METHOD_GET_CHILD = ReflectionUtils .findMethod (virtualFile , "getChild" , String .class );
86
86
87
87
VIRTUAL_FILE_VISITOR_INTERFACE = loader .loadClass (VFS3_PKG + "VirtualFileVisitor" );
@@ -124,7 +124,7 @@ static boolean exists(Object vfsResource) {
124
124
125
125
static boolean isReadable (Object vfsResource ) {
126
126
try {
127
- return (( Long ) invokeVfsMethod (VIRTUAL_FILE_METHOD_GET_SIZE , vfsResource ) > 0 ) ;
127
+ return (Long ) invokeVfsMethod (VIRTUAL_FILE_METHOD_GET_SIZE , vfsResource ) > 0 ;
128
128
}
129
129
catch (IOException ex ) {
130
130
return false ;
@@ -169,7 +169,7 @@ static Object getChild(Object vfsResource, String path) throws IOException {
169
169
}
170
170
171
171
static File getFile (Object vfsResource ) throws IOException {
172
- return (File ) invokeVfsMethod (GET_PHYSICAL_FILE , vfsResource );
172
+ return (File ) invokeVfsMethod (VIRTUAL_FILE_METHOD_GET_PHYSICAL_FILE , vfsResource );
173
173
}
174
174
175
175
static Object getRoot (URI url ) throws IOException {
0 commit comments