2362N/A * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved. 893N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 893N/A * This code is free software; you can redistribute it and/or modify it 893N/A * under the terms of the GNU General Public License version 2 only, as 2362N/A * published by the Free Software Foundation. Oracle designates this 893N/A * particular file as subject to the "Classpath" exception as provided 2362N/A * by Oracle in the LICENSE file that accompanied this code. 893N/A * This code is distributed in the hope that it will be useful, but WITHOUT 893N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 893N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 893N/A * version 2 for more details (a copy is included in the LICENSE file that 893N/A * accompanied this code). 893N/A * You should have received a copy of the GNU General Public License version 893N/A * 2 along with this work; if not, write to the Free Software Foundation, 893N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 2362N/A * or visit www.oracle.com if you need additional information or have any 893N/A * typedef struct _BY_HANDLE_FILE_INFORMATION { 893N/A * DWORD dwFileAttributes; 893N/A * FILETIME ftCreationTime; 893N/A * FILETIME ftLastAccessTime; 893N/A * FILETIME ftLastWriteTime; 893N/A * DWORD dwVolumeSerialNumber; 893N/A * DWORD nNumberOfLinks; 893N/A * DWORD nFileIndexHigh; 893N/A * } BY_HANDLE_FILE_INFORMATION; 893N/A * typedef struct _WIN32_FILE_ATTRIBUTE_DATA { 893N/A * DWORD dwFileAttributes; 893N/A * FILETIME ftCreationTime; 893N/A * FILETIME ftLastAccessTime; 893N/A * FILETIME ftLastWriteTime; 893N/A * } WIN32_FILE_ATTRIBUTE_DATA; 907N/A * typedef struct _WIN32_FIND_DATA { 907N/A * DWORD dwFileAttributes; 907N/A * FILETIME ftCreationTime; 907N/A * FILETIME ftLastAccessTime; 907N/A * FILETIME ftLastWriteTime; 907N/A * TCHAR cFileName[MAX_PATH]; 907N/A * TCHAR cAlternateFileName[14]; 1319N/A // used to adjust values between Windows and java epoch 893N/A // indicates if accurate metadata is required (interesting on NTFS only) 893N/A // additional attributes when using GetFileInformationByHandle 893N/A * Convert 64-bit value representing the number of 100-nanosecond intervals 1319N/A * since January 1, 1601 to a FileTime. 1319N/A * Convert FileTime to 64-bit value representing the number of 100-nanosecond 893N/A * intervals since January 1, 1601. 1319N/A // adjust to Windows epoch+= 11644473600000000L; 893N/A * Initialize a new instance of this class 893N/A * Create a WindowsFileAttributes from a BY_HANDLE_FILE_INFORMATION structure 893N/A * Create a WindowsFileAttributes from a WIN32_FILE_ATTRIBUTE_DATA structure 907N/A * Allocates a native buffer for a WIN32_FIND_DATA structure 907N/A * Create a WindowsFileAttributes from a WIN32_FIND_DATA structure 893N/A * Reads the attributes of an open file 893N/A // if file is a reparse point then read the tag 893N/A * Returns attributes of given file. 1476N/A // GetFileAttributesEx is the fastest way to read the attributes 893N/A // if reparse point then file may be a sym link; otherwise 893N/A // just return the attributes 1476N/A // For sharing violations, fallback to FindFirstFile if the file 1476N/A // is not a root directory. 1476N/A // FindFirstFile does not follow sym links. Even if 1476N/A // followLinks is false, there isn't sufficient information 1476N/A // in the WIN32_FIND_DATA structure to know if the reparse 893N/A // file is reparse point so need to open file to get attributes 1576N/A * Returns true if the attributes are of the same file - both files must 893N/A // volume serial number and file index must be the same 1576N/A * Returns true if the attributes are of a file with a reparse point. 893N/A // ignore FILE_ATTRIBUTE_DIRECTORY attribute if file is a sym link 893N/A // return true if device or reparse point