00001 using System;
00002 using System.IO;
00003
00004 namespace Tamir.SharpSsh.java.io
00005 {
00009 public class File
00010 {
00011 string file;
00012 internal FileInfo info;
00013
00014 public File(string file)
00015 {
00016 this.file = file;
00017 info = new FileInfo(file);
00018 }
00019
00020 public string getCanonicalPath()
00021 {
00022 return Path.GetFullPath(file);
00023 }
00024
00025 public bool isDirectory()
00026 {
00027 return Directory.Exists(file);
00028 }
00029
00030 public long Length()
00031 {
00032 return info.Length;
00033 }
00034
00035 public long length()
00036 {
00037 return Length();
00038 }
00039
00040 public bool isAbsolute()
00041 {
00042 return Path.IsPathRooted(file);
00043 }
00044
00045 public java.String[] list()
00046 {
00047 string [] dirs = Directory.GetDirectories(file);
00048 string [] files = Directory.GetFiles(file);
00049 java.String[] _list = new java.String[dirs.Length+files.Length];
00050 System.arraycopy(dirs, 0, _list, 0, dirs.Length);
00051 System.arraycopy(files, 0, _list, dirs.Length, files.Length);
00052 return _list;
00053 }
00054
00055 public static string separator
00056 {
00057 get
00058 {
00059 return Path.DirectorySeparatorChar.ToString();
00060 }
00061 }
00062
00063 public static char separatorChar
00064 {
00065 get
00066 {
00067 return Path.DirectorySeparatorChar;
00068 }
00069 }
00070 }
00071 }