src/share/classes/sun/nio/fs/AbstractFileSystemProvider.java
Print this page
*** 27,37 ****
import java.nio.file.*;
import java.nio.file.spi.FileSystemProvider;
import java.io.IOException;
import java.util.Map;
- import java.util.Collections;
/**
* Base implementation class of FileSystemProvider
*/
--- 27,36 ----
*** 70,79 ****
--- 69,80 ----
Object value,
LinkOption... options)
throws IOException
{
String[] s = split(attribute);
+ if (s[0].length() == 0)
+ throw new IllegalArgumentException(attribute);
DynamicFileAttributeView view = getFileAttributeView(file, s[0], options);
if (view == null)
throw new UnsupportedOperationException("View '" + s[0] + "' not available");
view.setAttribute(s[1], value);
}
*** 81,93 ****
@Override
public final Map<String,Object> readAttributes(Path file, String attributes, LinkOption... options)
throws IOException
{
String[] s = split(attributes);
DynamicFileAttributeView view = getFileAttributeView(file, s[0], options);
if (view == null)
! return Collections.emptyMap();
return view.readAttributes(s[1].split(","));
}
/**
* Deletes a file. The {@code failIfNotExists} parameters determines if an
--- 82,96 ----
@Override
public final Map<String,Object> readAttributes(Path file, String attributes, LinkOption... options)
throws IOException
{
String[] s = split(attributes);
+ if (s[0].length() == 0)
+ throw new IllegalArgumentException(attributes);
DynamicFileAttributeView view = getFileAttributeView(file, s[0], options);
if (view == null)
! throw new UnsupportedOperationException("View '" + s[0] + "' not available");
return view.readAttributes(s[1].split(","));
}
/**
* Deletes a file. The {@code failIfNotExists} parameters determines if an