mirror of
https://github.com/openjdk/jdk.git
synced 2026-04-23 05:10:57 +00:00
8040262: (fs) Misc. typos in comments and implementation
Reviewed-by: alanb, chegar
This commit is contained in:
parent
1e12679af1
commit
d7649dfc7e
@ -38,7 +38,6 @@ import java.io.Reader;
|
||||
import java.io.UncheckedIOException;
|
||||
import java.io.Writer;
|
||||
import java.nio.channels.Channels;
|
||||
import java.nio.channels.FileChannel;
|
||||
import java.nio.channels.SeekableByteChannel;
|
||||
import java.nio.charset.Charset;
|
||||
import java.nio.charset.CharsetDecoder;
|
||||
@ -739,7 +738,7 @@ public final class Files {
|
||||
// don't have permission to get absolute path
|
||||
se = x;
|
||||
}
|
||||
// find a decendent that exists
|
||||
// find a descendant that exists
|
||||
Path parent = dir.getParent();
|
||||
while (parent != null) {
|
||||
try {
|
||||
@ -1400,7 +1399,7 @@ public final class Files {
|
||||
return target;
|
||||
}
|
||||
|
||||
// -- Miscellenous --
|
||||
// -- Miscellaneous --
|
||||
|
||||
/**
|
||||
* Reads the target of a symbolic link <i>(optional operation)</i>.
|
||||
@ -1535,7 +1534,7 @@ public final class Files {
|
||||
private static class FileTypeDetectors{
|
||||
static final FileTypeDetector defaultFileTypeDetector =
|
||||
createDefaultFileTypeDetector();
|
||||
static final List<FileTypeDetector> installeDetectors =
|
||||
static final List<FileTypeDetector> installedDetectors =
|
||||
loadInstalledDetectors();
|
||||
|
||||
// creates the default file type detector
|
||||
@ -1614,7 +1613,7 @@ public final class Files {
|
||||
throws IOException
|
||||
{
|
||||
// try installed file type detectors
|
||||
for (FileTypeDetector detector: FileTypeDetectors.installeDetectors) {
|
||||
for (FileTypeDetector detector: FileTypeDetectors.installedDetectors) {
|
||||
String result = detector.probeContentType(path);
|
||||
if (result != null)
|
||||
return result;
|
||||
@ -1922,7 +1921,7 @@ public final class Files {
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td> {@code "posix:permissions,owner,size"} </td>
|
||||
* <td> Reads the POSX file permissions, owner, and file size. </td>
|
||||
* <td> Reads the POSIX file permissions, owner, and file size. </td>
|
||||
* </tr>
|
||||
* </table>
|
||||
* </blockquote>
|
||||
@ -2448,7 +2447,7 @@ public final class Files {
|
||||
}
|
||||
|
||||
/**
|
||||
* Used by isReadbale, isWritable, isExecutable to test access to a file.
|
||||
* Used by isReadable, isWritable, isExecutable to test access to a file.
|
||||
*/
|
||||
private static boolean isAccessible(Path path, AccessMode... modes) {
|
||||
try {
|
||||
|
||||
@ -81,7 +81,7 @@ public abstract class FileSystemProvider {
|
||||
// installed providers
|
||||
private static volatile List<FileSystemProvider> installedProviders;
|
||||
|
||||
// used to avoid recursive loading of instaled providers
|
||||
// used to avoid recursive loading of installed providers
|
||||
private static boolean loadingProviders = false;
|
||||
|
||||
private static Void checkPermission() {
|
||||
|
||||
@ -77,7 +77,7 @@ class LinuxNativeDispatcher extends UnixNativeDispatcher {
|
||||
}
|
||||
|
||||
private static native int fgetxattr0(int filedes, long nameAddress,
|
||||
long valueAdddress, int valueLen) throws UnixException;
|
||||
long valueAddress, int valueLen) throws UnixException;
|
||||
|
||||
/**
|
||||
* fsetxattr(int filedes, const char *name, const void *value, size_t size, int flags);
|
||||
@ -94,7 +94,7 @@ class LinuxNativeDispatcher extends UnixNativeDispatcher {
|
||||
}
|
||||
|
||||
private static native void fsetxattr0(int filedes, long nameAddress,
|
||||
long valueAdddress, int valueLen) throws UnixException;
|
||||
long valueAddress, int valueLen) throws UnixException;
|
||||
|
||||
/**
|
||||
* fremovexattr(int filedes, const char *name);
|
||||
|
||||
@ -36,7 +36,7 @@ import java.security.PrivilegedAction;
|
||||
|
||||
class MagicFileTypeDetector extends AbstractFileTypeDetector {
|
||||
|
||||
private static final String UNKNOW_MIME_TYPE = "application/octet-stream";
|
||||
private static final String UNKNOWN_MIME_TYPE = "application/octet-stream";
|
||||
|
||||
// true if libmagic is available and successfully loaded
|
||||
private final boolean libmagicAvailable;
|
||||
@ -57,7 +57,7 @@ class MagicFileTypeDetector extends AbstractFileTypeDetector {
|
||||
try {
|
||||
byte[] type = probe0(buffer.address());
|
||||
String mimeType = (type == null) ? null : new String(type);
|
||||
return UNKNOW_MIME_TYPE.equals(mimeType) ? null : mimeType;
|
||||
return UNKNOWN_MIME_TYPE.equals(mimeType) ? null : mimeType;
|
||||
} finally {
|
||||
buffer.release();
|
||||
}
|
||||
|
||||
@ -290,7 +290,7 @@ class SolarisAclFileAttributeView
|
||||
return acl;
|
||||
}
|
||||
|
||||
// Retrns true if NFSv4 ACLs not enabled on file system
|
||||
// Returns true if NFSv4 ACLs not enabled on file system
|
||||
private static boolean isAclsEnabled(int fd) {
|
||||
try {
|
||||
long enabled = fpathconf(fd, _PC_ACL_ENABLED);
|
||||
|
||||
@ -627,14 +627,14 @@ class SolarisWatchService
|
||||
|
||||
/**
|
||||
* Update watch key's events. If ENTRY_MODIFY changes to be enabled
|
||||
* then register each file in the direcory; If ENTRY_MODIFY changed to
|
||||
* then register each file in the directory; If ENTRY_MODIFY changed to
|
||||
* be disabled then unregister each file.
|
||||
*/
|
||||
void updateEvents(SolarisWatchKey key, Set<? extends WatchEvent.Kind<?>> events)
|
||||
throws UnixException
|
||||
{
|
||||
|
||||
// update events, rembering if ENTRY_MODIFY was previously
|
||||
// update events, remembering if ENTRY_MODIFY was previously
|
||||
// enabled or disabled.
|
||||
boolean oldModifyEnabled = key.events()
|
||||
.contains(StandardWatchEventKinds.ENTRY_MODIFY);
|
||||
|
||||
@ -48,7 +48,7 @@ class UnixDirectoryStream
|
||||
// filter (may be null)
|
||||
private final DirectoryStream.Filter<? super Path> filter;
|
||||
|
||||
// used to coorindate closing of directory stream
|
||||
// used to coordinate closing of directory stream
|
||||
private final ReentrantReadWriteLock streamLock =
|
||||
new ReentrantReadWriteLock(true);
|
||||
|
||||
|
||||
@ -133,7 +133,7 @@ class UnixFileAttributeViews {
|
||||
private static final String OWNER_NAME = "owner";
|
||||
private static final String GROUP_NAME = "group";
|
||||
|
||||
// the names of the posix attributes (incudes basic)
|
||||
// the names of the posix attributes (includes basic)
|
||||
static final Set<String> posixAttributeNames =
|
||||
Util.newSet(basicAttributeNames, PERMISSIONS_NAME, OWNER_NAME, GROUP_NAME);
|
||||
|
||||
|
||||
@ -339,7 +339,7 @@ abstract class UnixFileSystem
|
||||
};
|
||||
}
|
||||
|
||||
// Override if the platform has different path match requrement, such as
|
||||
// Override if the platform has different path match requirement, such as
|
||||
// case insensitive or Unicode canonical equal on MacOSX
|
||||
Pattern compilePathMatchPattern(String expr) {
|
||||
return Pattern.compile(expr);
|
||||
|
||||
@ -61,7 +61,7 @@ class WindowsAclFileAttributeView
|
||||
this.followLinks = followLinks;
|
||||
}
|
||||
|
||||
// permision check
|
||||
// permission check
|
||||
private void checkAccess(WindowsPath file,
|
||||
boolean checkRead,
|
||||
boolean checkWrite)
|
||||
|
||||
@ -94,7 +94,7 @@ class WindowsConstants {
|
||||
public static final int ERROR_NOT_READY = 21;
|
||||
public static final int ERROR_SHARING_VIOLATION = 32;
|
||||
public static final int ERROR_FILE_EXISTS = 80;
|
||||
public static final int ERROR_INVALID_PARAMATER = 87;
|
||||
public static final int ERROR_INVALID_PARAMETER = 87;
|
||||
public static final int ERROR_DISK_FULL = 112;
|
||||
public static final int ERROR_INSUFFICIENT_BUFFER = 122;
|
||||
public static final int ERROR_INVALID_LEVEL = 124;
|
||||
|
||||
@ -98,9 +98,9 @@ class WindowsFileAttributeViews {
|
||||
lastAccessTime,
|
||||
lastWriteTime);
|
||||
} catch (WindowsException x) {
|
||||
// If ERROR_INVALID_PARAMATER is returned and the volume is
|
||||
// If ERROR_INVALID_PARAMETER is returned and the volume is
|
||||
// FAT then adjust to the FAT epoch and retry.
|
||||
if (followLinks && x.lastError() == ERROR_INVALID_PARAMATER) {
|
||||
if (followLinks && x.lastError() == ERROR_INVALID_PARAMETER) {
|
||||
try {
|
||||
if (WindowsFileStore.create(file).type().equals("FAT")) {
|
||||
SetFileTime(handle,
|
||||
@ -157,7 +157,7 @@ class WindowsFileAttributeViews {
|
||||
private static final String HIDDEN_NAME = "hidden";
|
||||
private static final String ATTRIBUTES_NAME = "attributes";
|
||||
|
||||
// the names of the DOS attribtues (includes basic)
|
||||
// the names of the DOS attributes (includes basic)
|
||||
static final Set<String> dosAttributeNames =
|
||||
Util.newSet(basicAttributeNames,
|
||||
READONLY_NAME, ARCHIVE_NAME, SYSTEM_NAME, HIDDEN_NAME, ATTRIBUTES_NAME);
|
||||
@ -223,7 +223,7 @@ class WindowsFileAttributeViews {
|
||||
{
|
||||
file.checkWrite();
|
||||
|
||||
// GetFileAttribtues & SetFileAttributes do not follow links so when
|
||||
// GetFileAttributes & SetFileAttributes do not follow links so when
|
||||
// following links we need the final target
|
||||
String path = WindowsLinkSupport.getFinalPath(file, followLinks);
|
||||
try {
|
||||
|
||||
@ -384,7 +384,7 @@ public class WindowsFileSystemProvider
|
||||
file.getPathForExceptionMessage(), null,
|
||||
"Permissions does not allow requested access");
|
||||
|
||||
// for write access we neeed to check if the DOS readonly attribute
|
||||
// for write access we need to check if the DOS readonly attribute
|
||||
// and if the volume is read-only
|
||||
if (w) {
|
||||
try {
|
||||
@ -553,7 +553,7 @@ public class WindowsFileSystemProvider
|
||||
}
|
||||
|
||||
/*
|
||||
* Windows treates symbolic links to directories differently than it
|
||||
* Windows treats symbolic links to directories differently than it
|
||||
* does to other file types. For that reason we need to check if the
|
||||
* target is a directory (or a directory junction).
|
||||
*/
|
||||
|
||||
@ -917,7 +917,7 @@ class WindowsNativeDispatcher {
|
||||
}
|
||||
}
|
||||
private static native void CreateHardLink0(long newFileBuffer,
|
||||
long existingFiletBuffer) throws WindowsException;
|
||||
long existingFileBuffer) throws WindowsException;
|
||||
|
||||
/**
|
||||
* GetFullPathName(
|
||||
|
||||
@ -133,7 +133,7 @@ class WindowsPath extends AbstractPath {
|
||||
|
||||
/**
|
||||
* Special implementation with attached/cached attributes (used to quicken
|
||||
* file tree traveral)
|
||||
* file tree traversal)
|
||||
*/
|
||||
private static class WindowsPathWithAttributes
|
||||
extends WindowsPath implements BasicFileAttributesHolder
|
||||
|
||||
@ -129,11 +129,11 @@ class WindowsSecurity {
|
||||
int genericRead, int genericWrite, int genericExecute, int genericAll)
|
||||
throws WindowsException
|
||||
{
|
||||
int privilegies = TOKEN_QUERY;
|
||||
long hToken = OpenThreadToken(GetCurrentThread(), privilegies, false);
|
||||
int privileges = TOKEN_QUERY;
|
||||
long hToken = OpenThreadToken(GetCurrentThread(), privileges, false);
|
||||
if (hToken == 0L && processTokenWithDuplicateAccess != 0L)
|
||||
hToken = DuplicateTokenEx(processTokenWithDuplicateAccess,
|
||||
privilegies);
|
||||
privileges);
|
||||
|
||||
boolean hasRight = false;
|
||||
if (hToken != 0L) {
|
||||
|
||||
@ -200,7 +200,7 @@ class WindowsUserDefinedFileAttributeView
|
||||
public List<String> list() throws IOException {
|
||||
if (System.getSecurityManager() != null)
|
||||
checkAccess(file.getPathForPermissionCheck(), true, false);
|
||||
// use stream APIs on Windwos Server 2003 and newer
|
||||
// use stream APIs on Windows Server 2003 and newer
|
||||
if (file.getFileSystem().supportsStreamEnumeration()) {
|
||||
return listUsingStreamEnumeration();
|
||||
} else {
|
||||
|
||||
@ -556,7 +556,7 @@ class WindowsWatchService
|
||||
// ReadDirectoryChangesW failed
|
||||
criticalError = true;
|
||||
} else {
|
||||
// ERROR_MORE_DATA is a warning about incomplite
|
||||
// ERROR_MORE_DATA is a warning about incomplete
|
||||
// data transfer over TCP/UDP stack. For the case
|
||||
// [messageSize] is zero in the most of cases.
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user