クリックして評価とフィードバックをお寄せください
MSDN
MSDN ライブラリ
Visual Studio 2005
Visual Studio ドキュメント
Visual J#
Visual J# リファレンス
Visual J# Class Library
java.io
File Class
File Methods
 isAbsolute Method
すべて縮小/すべて展開 すべて縮小
Visual J# Reference
File.isAbsolute Method

Determines whether the pathname of the file or folder is absolute.

Package: java.io

Assembly: vjslib (in vjslib.dll)

public boolean isAbsolute();

true if the pathname of the file or folder represented by the File object is absolute; false otherwise.

The following example shows how to determine if a file path is absolute.

// file_isabsolute.jsl

import java.io.*;

public class Program
{
    public static void main(String[] args)
    {
        // Create a File object using C:\MyFile.txt.
        File myFile = new File("C:\\MyFile.txt");

        // Create a File using YourFile.txt.
        File yourFile = new File("YourFile.txt");

        // Which of these files have absolute paths?
        if (myFile.isAbsolute())
        {
            System.out.println(myFile.getName() +
                " is absolute.");
        }
        else
        {
            System.out.println(myFile.getName() +
                " is NOT absolute.");
        }

        if (yourFile.isAbsolute())
        {
            System.out.println(yourFile.getName() +
                " is absolute.");
        }
        else
        {
            System.out.println(yourFile.getName() +
                " is NOT absolute.");
        }
    }
}

/*
Output:
MyFile.txt is absolute.
YourFile.txt is NOT absolute.
*/
コミュニティ コンテンツ   コミュニティ コンテンツとは
新しいコンテンツの追加 RSS  注釈
Processing
© 2010 Microsoft Corporation. All rights reserved. 使用条件 | 商標 | プライバシー
Page view tracker