jp.sourceforge.gtibuilder.io.filesystem
クラス GBFile

java.lang.Object
  拡張jp.sourceforge.gtibuilder.io.filesystem.GBFile
すべての実装インタフェース:
Serializable
直系の既知のサブクラス:
Root

public class GBFile
extends Object
implements Serializable

GTI Builderのデスクトップにあるファイルを表します。

関連項目:
直列化された形式

フィールドの概要
private  byte[] data
           
private  boolean directory
           
private  boolean exists
           
private  boolean file
           
private  FileType fileType
           
private  FileUpdateManager fumanager
           
private  StringArray infomation
           
private  Vector list
           
private  String name
           
private  GBFile parent
           
private  Project project
           
 
コンストラクタの概要
protected GBFile(Project project)
           
private GBFile(String name, Project project, GBFile parent, boolean exists, boolean directory, boolean file)
          Creates a new instance of GBFile
private GBFile(String name, Project project, GBFile parent, boolean exists, boolean directory, boolean file, byte[] info)
           
 
メソッドの概要
private  boolean addFile(GBFile file)
          このGBFileがディレクトリである場合にfileを追加します。
 void addFileUpdateListener(FileUpdateListener listener)
          GBFileの名前やディレクトリが変更された時に通知されるリスナーを追加します。
 boolean createNewFile()
          このファイルがまだ存在しないとき普通のファイルを作成します。
 boolean delete()
          このファイルを削除します。
 boolean exists()
          このファイルが存在するときにtrueを返します。
 byte[] getData()
          このGBFileが表すデータを取得します。
 EditorComponent getEditorComponent()
           
 String getFileInfomation(String key)
           
 FileType getFileType()
           
 GBFile getGBFile(String path)
           
static GBFile getGBFile(String path, Project project)
          GBFileのインスタンスを取得するときに使います。
 String getName()
          ファイル名を返します
 String getParent()
          このファイルの親のパスを返します。
 GBFile getParentFile()
          このファイルの親を返します。
 String getPath()
          このファイルのパスを返します。
static GBFile getRoot(Project project)
          projectRootを取得します。
 boolean isDirectory()
          このファイルがディレクトリのときにtrueを返します。
 boolean isFile()
          このファイルが普通のファイルのときにtrueを返します。
 boolean isRoot()
           
 String[] list()
          このファイルがディレクトリだった場合、その子のパスを返します。
 GBFile[] listFile()
          このファイルがディレクトリだった場合、その子を返します。
 boolean mkdir()
          このファイルがまだ存在しないときディレクトリを作成します。
private  boolean removeFile(GBFile file)
           
 void removeFileUpdateListener(FileUpdateListener listener)
          GBFileの名前やディレクトリが変更された時に通知されるリスナーを削除します。
 boolean setData(byte[] data)
           
 void setFileInfomation(String key, String obj)
           
 void setFileType(FileType ft)
           
 boolean setName(String newName)
          このファイルの名前を指定します。
 boolean setParentFile(GBFile file)
          このファイルの親を指定します。
 String toString()
          このファイルのパスを返します。
 
クラス java.lang.Object から継承したメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

フィールドの詳細

directory

private boolean directory

file

private boolean file

exists

private boolean exists

name

private String name

parent

private GBFile parent

fileType

private FileType fileType

data

private byte[] data

list

private Vector list

project

private Project project

fumanager

private FileUpdateManager fumanager

infomation

private StringArray infomation
コンストラクタの詳細

GBFile

private GBFile(String name,
               Project project,
               GBFile parent,
               boolean exists,
               boolean directory,
               boolean file)
Creates a new instance of GBFile


GBFile

private GBFile(String name,
               Project project,
               GBFile parent,
               boolean exists,
               boolean directory,
               boolean file,
               byte[] info)

GBFile

protected GBFile(Project project)
メソッドの詳細

getGBFile

public static GBFile getGBFile(String path,
                               Project project)
GBFileのインスタンスを取得するときに使います。 同じファイルが要求された場合は同じインスタンスを返します。


getGBFile

public GBFile getGBFile(String path)

addFile

private boolean addFile(GBFile file)
このGBFileがディレクトリである場合にfileを追加します。fileはディレクトリでも普通のファイルでもかまいません。


removeFile

private boolean removeFile(GBFile file)

createNewFile

public boolean createNewFile()
このファイルがまだ存在しないとき普通のファイルを作成します。


mkdir

public boolean mkdir()
このファイルがまだ存在しないときディレクトリを作成します。
java.io.File.mkdirs()に同じです。


delete

public boolean delete()
このファイルを削除します。


exists

public boolean exists()
このファイルが存在するときにtrueを返します。


toString

public String toString()
このファイルのパスを返します。


getName

public String getName()
ファイル名を返します


setName

public boolean setName(String newName)
このファイルの名前を指定します。


getPath

public String getPath()
このファイルのパスを返します。


getParent

public String getParent()
このファイルの親のパスを返します。


setParentFile

public boolean setParentFile(GBFile file)
このファイルの親を指定します。


getParentFile

public GBFile getParentFile()
このファイルの親を返します。


isDirectory

public boolean isDirectory()
このファイルがディレクトリのときにtrueを返します。


isFile

public boolean isFile()
このファイルが普通のファイルのときにtrueを返します。


list

public String[] list()
このファイルがディレクトリだった場合、その子のパスを返します。


listFile

public GBFile[] listFile()
このファイルがディレクトリだった場合、その子を返します。


getRoot

public static GBFile getRoot(Project project)
projectRootを取得します。

パラメータ:
project - Rootを取得するプロジェクトを指定します。

getData

public byte[] getData()
このGBFileが表すデータを取得します。


setData

public boolean setData(byte[] data)

setFileType

public void setFileType(FileType ft)

getFileType

public FileType getFileType()

isRoot

public boolean isRoot()

getEditorComponent

public EditorComponent getEditorComponent()

addFileUpdateListener

public void addFileUpdateListener(FileUpdateListener listener)
GBFileの名前やディレクトリが変更された時に通知されるリスナーを追加します。


removeFileUpdateListener

public void removeFileUpdateListener(FileUpdateListener listener)
GBFileの名前やディレクトリが変更された時に通知されるリスナーを削除します。


setFileInfomation

public void setFileInfomation(String key,
                              String obj)

getFileInfomation

public String getFileInfomation(String key)