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