Permalink
Browse files

o Java 7 file attributes now work on Windows ( TM )

  • Loading branch information...
1 parent 05b1968 commit e92b1859bc512d1ee4725a8efddad1297460d078 @krosenvold krosenvold committed with krosenvold Jun 27, 2011
View
@@ -3,3 +3,7 @@ target/
.classpath
.settings/
bin
+*.ipr
+*.iml
+*.iws
+
@@ -110,26 +110,11 @@
public static Object getPosixFileAttributes( File file )
throws IOException
{
-/* final Path path = file.toPath();
-
- final PosixFileAttributes posixFileAttributes =
- Files.readAttributes( path, PosixFileAttributes.class, LinkOption.NOFOLLOW_LINKS );
- */
final Object path = invoke( pathMethod, file );
return invoke( readAttributes, null, path, posixFileAttributes, arr );
}
- /*
- final UserPrincipal ownerUserPrincipal = posixFileAttributes.owner();
- this.userName = ownerUserPrincipal.getName();
- this.groupName = posixFileAttributes.group().getName();
-
- final Set<PosixFilePermission> permissions = posixFileAttributes.permissions();
- mode = PosixFilePermissions.toString( permissions ).toCharArray();
-
-
- */
public static String getOwnerUserName( Object posixFileAttributes )
{
/*
@@ -213,16 +213,17 @@ public static Map getFileAttributesByPath( File dir, Logger logger, int logLevel
boolean includeNumericUserId )
throws IOException
{
- if ( Java7Reflector.isJava7() )
- {
- return getFileAttributesByPathJava7( dir, recursive );
- }
if ( !enabledOnCurrentOperatingSystem() )
{
//noinspection unchecked
return Collections.EMPTY_MAP;
}
+ if ( Java7Reflector.isJava7() )
+ {
+ return getFileAttributesByPathJava7( dir, recursive );
+ }
+
if ( logger == null )
{
logger = new ConsoleLogger( Logger.LEVEL_INFO, "Internal" );
@@ -75,6 +75,10 @@ public void testFolderJava7()
throws IOException
{
+ if (Os.isFamily( Os.FAMILY_WINDOWS ) || Os.isFamily( Os.FAMILY_WIN9X )){
+ return; // Nothing to do here.
+ }
+
URL resource = Thread.currentThread().getContextClassLoader().getResource(
getClass().getName().replace( '.', '/' ) + ".class" );

0 comments on commit e92b185

Please sign in to comment.