jdk/src/windows/classes/sun/nio/fs/WindowsFileAttributeViews.java
changeset 23887 7b2fb8d5f6be
parent 9035 1255eb81cc2f
equal deleted inserted replaced
23886:6cb6ad1e208f 23887:7b2fb8d5f6be
    96                 SetFileTime(handle,
    96                 SetFileTime(handle,
    97                             createTime,
    97                             createTime,
    98                             lastAccessTime,
    98                             lastAccessTime,
    99                             lastWriteTime);
    99                             lastWriteTime);
   100             } catch (WindowsException x) {
   100             } catch (WindowsException x) {
   101                 // If ERROR_INVALID_PARAMATER is returned and the volume is
   101                 // If ERROR_INVALID_PARAMETER is returned and the volume is
   102                 // FAT then adjust to the FAT epoch and retry.
   102                 // FAT then adjust to the FAT epoch and retry.
   103                 if (followLinks && x.lastError() == ERROR_INVALID_PARAMATER) {
   103                 if (followLinks && x.lastError() == ERROR_INVALID_PARAMETER) {
   104                     try {
   104                     try {
   105                         if (WindowsFileStore.create(file).type().equals("FAT")) {
   105                         if (WindowsFileStore.create(file).type().equals("FAT")) {
   106                             SetFileTime(handle,
   106                             SetFileTime(handle,
   107                                         adjustForFatEpoch(createTime),
   107                                         adjustForFatEpoch(createTime),
   108                                         adjustForFatEpoch(lastAccessTime),
   108                                         adjustForFatEpoch(lastAccessTime),
   155         private static final String ARCHIVE_NAME = "archive";
   155         private static final String ARCHIVE_NAME = "archive";
   156         private static final String SYSTEM_NAME = "system";
   156         private static final String SYSTEM_NAME = "system";
   157         private static final String HIDDEN_NAME = "hidden";
   157         private static final String HIDDEN_NAME = "hidden";
   158         private static final String ATTRIBUTES_NAME = "attributes";
   158         private static final String ATTRIBUTES_NAME = "attributes";
   159 
   159 
   160         // the names of the DOS attribtues (includes basic)
   160         // the names of the DOS attributes (includes basic)
   161         static final Set<String> dosAttributeNames =
   161         static final Set<String> dosAttributeNames =
   162             Util.newSet(basicAttributeNames,
   162             Util.newSet(basicAttributeNames,
   163                         READONLY_NAME, ARCHIVE_NAME, SYSTEM_NAME,  HIDDEN_NAME, ATTRIBUTES_NAME);
   163                         READONLY_NAME, ARCHIVE_NAME, SYSTEM_NAME,  HIDDEN_NAME, ATTRIBUTES_NAME);
   164 
   164 
   165         Dos(WindowsPath file, boolean followLinks) {
   165         Dos(WindowsPath file, boolean followLinks) {
   221         private void updateAttributes(int flag, boolean enable)
   221         private void updateAttributes(int flag, boolean enable)
   222             throws IOException
   222             throws IOException
   223         {
   223         {
   224             file.checkWrite();
   224             file.checkWrite();
   225 
   225 
   226             // GetFileAttribtues & SetFileAttributes do not follow links so when
   226             // GetFileAttributes & SetFileAttributes do not follow links so when
   227             // following links we need the final target
   227             // following links we need the final target
   228             String path = WindowsLinkSupport.getFinalPath(file, followLinks);
   228             String path = WindowsLinkSupport.getFinalPath(file, followLinks);
   229             try {
   229             try {
   230                 int oldValue = GetFileAttributes(path);
   230                 int oldValue = GetFileAttributes(path);
   231                 int newValue = oldValue;
   231                 int newValue = oldValue;