private void Prepare() { var file = new File(TempFile()); if (file.Exists()) { file.Delete(); } var testDB = OpenDB(); var item = new Item("richard" , 100); testDB.Store(item); testDB.Close(); }
public Db4oDrsFixture(string name, IReflector reflector) { _name = name; File folder = new File(Path); if (!folder.Exists()) { Sharpen.Runtime.Out.WriteLine("Path " + Path + " does not exist. Using current working folder." ); Sharpen.Runtime.Out.WriteLine("Check the " + RamDriveProperty + " environment variable on your system." ); folder = new File("."); } testFile = new File(folder.GetPath() + "/drs_cs_" + _name + ".db4o"); if (reflector != null) { Config().ReflectWith(reflector); } }
/// <exception cref="System.IO.IOException"></exception> public virtual void ReadFrom(File file) { if (!file.Exists()) { throw new IOException(Messages.Get(41, file.GetAbsolutePath ())); } i_length = (int)file.Length(); CheckExt(file); if (i_stream.IsClient) { i_file = file; ((IBlobTransport)i_stream).ReadBlobFrom(i_trans, this); } else { ReadLocal(file); } }
/// <exception cref="System.IO.IOException"></exception> public virtual void ReadFrom(File file) { if (!file.Exists()) { throw new IOException(Messages.Get(41, file.GetAbsolutePath ())); } i_length = (int) file.Length(); CheckExt(file); if (i_stream.IsClient) { i_file = file; ((IBlobTransport) i_stream).ReadBlobFrom(i_trans, this); } else { ReadLocal(file); } }
/// <exception cref="System.IO.IOException"></exception> public virtual void ReadLocal(File file) { var copied = false; if (fileName == null) { var newFile = new File(ServerPath(), file.GetName()); if (!newFile.Exists()) { Copy(file, newFile); copied = true; fileName = newFile.GetName(); } } if (!copied) { Copy(file, ServerFile(CheckExt(file), true)); } lock (i_stream.Lock()) { i_stream.StoreInternal(i_trans, this, false); } i_status = Status.Completed; }
/// <summary>returns true if the specified file system path already exists.</summary> /// <remarks>returns true if the specified file system path already exists.</remarks> public virtual bool Exists(string uri) { Sharpen.IO.File file = new Sharpen.IO.File(uri); return(file.Exists() && file.Length() > 0); }
public override bool Exists(string path) { Sharpen.IO.File existingFile = new Sharpen.IO.File(path); return existingFile.Exists() && existingFile.Length() > 0; }
public override bool Exists(string path) { Sharpen.IO.File existingFile = new Sharpen.IO.File(path); return(existingFile.Exists() && existingFile.Length() > 0); }
/// <summary>returns true if the specified file system path already exists.</summary> /// <remarks>returns true if the specified file system path already exists.</remarks> public virtual bool Exists(string uri) { Sharpen.IO.File file = new Sharpen.IO.File(uri); return file.Exists() && file.Length() > 0; }
public override bool Exists(string path) { var existingFile = new File(path); return(existingFile.Exists() && existingFile.Length() > 0); }
public override bool Exists(string path) { var existingFile = new File(path); return existingFile.Exists() && existingFile.Length() > 0; }
/// <summary>returns true if the specified file system path already exists.</summary> /// <remarks>returns true if the specified file system path already exists.</remarks> public virtual bool Exists(string uri) { var file = new File(uri); return(file.Exists() && file.Length() > 0); }
/// <summary>returns true if the specified file system path already exists.</summary> /// <remarks>returns true if the specified file system path already exists.</remarks> public virtual bool Exists(string uri) { var file = new File(uri); return file.Exists() && file.Length() > 0; }