Home > Contents > Index >
Expanded TOC | Accordion TOC | Annotated TOC | Index
Utilities.isFile
Verifies the existence of a file.
Syntax
public static final int isFile(String path)Parameters
path
- Input. Specify the pathname of the file to check.
Description
The
isFile
method verifies the existence of a file. The method first checks that the argument is agoodString()
and then converts it usingosSafeSpec()
before checking that the file exists.Returns
Returns zero (0) on success, or error code on error.
Example
The following code gets the directory assigned to the
cs.pagecachefolder
property and then determines if that directory contains a file namedfoo.txt
:
String Property = "CS.Property.cs.pagecachefolder"; String path = ics.ResolveVariables(Property); if ( Utilities.isFile ( path + "/foo.txt" ) == 0 ) { // process file }See Also
Home > Contents > Index > Oracle JAVA Reference
Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.