/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/**
* Windows implementation of FileStore.
*/
class WindowsFileStore
extends FileStore
{
private final int volType;
// file store "display name" is the volume name if available
this.displayName = vol;
} else {
// TBD - should we map all types? Does this need to be localized?
}
}
throws IOException
{
try {
return new WindowsFileStore(root);
} catch (WindowsException x) {
return null;
return null; // keep compiler happy
}
}
try {
// if the file is a link then GetVolumePathName returns the
// volume that the link is on so we need to call it with the
// final target
} else {
// file must exist
}
return new WindowsFileStore(root);
} catch (WindowsException x) {
return null; // keep compiler happy
}
}
return volInfo;
}
int volumeType() {
return volType;
}
}
}
public boolean isReadOnly() {
}
// read the free space info
try {
return GetDiskFreeSpaceEx(root);
} catch (WindowsException x) {
return null;
}
}
return readDiskFreeSpace().totalNumberOfBytes();
}
return readDiskFreeSpace().freeBytesAvailable();
}
return readDiskFreeSpace().freeBytesAvailable();
}
throw new NullPointerException();
return (V) null;
}
// standard
return getTotalSpace();
return getUsableSpace();
return getUnallocatedSpace();
// windows specific for testing purposes
return volInfo.volumeSerialNumber();
return volType == DRIVE_REMOVABLE;
return volType == DRIVE_CDROM;
}
throw new NullPointerException();
return true;
if (type == UserDefinedFileAttributeView.class)
return false;
}
return true;
return supportsFileAttributeView(AclFileAttributeView.class);
return supportsFileAttributeView(FileOwnerAttributeView.class);
return supportsFileAttributeView(UserDefinedFileAttributeView.class);
return false;
}
if (ob == this)
return true;
if (!(ob instanceof WindowsFileStore))
return false;
}
public int hashCode() {
}
// drop trailing slash
}
}