예제 #1
0
 /// <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);
     }
 }
예제 #2
0
파일: BlobImpl.cs 프로젝트: masroore/db4o
 /// <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);
     }
 }
예제 #3
0
 public virtual void ProcessAtServer()
 {
     try
     {
         BlobImpl blobImpl = this.ServerGetBlobImpl();
         if (blobImpl != null)
         {
             blobImpl.SetTrans(Transaction());
             Sharpen.IO.File file   = blobImpl.ServerFile(null, false);
             int             length = (int)file.Length();
             Socket4Adapter  sock   = ServerMessageDispatcher().Socket();
             Msg.Length.GetWriterForInt(Transaction(), length).Write(sock);
             FileInputStream fin = new FileInputStream(file);
             Copy(fin, sock, false);
             sock.Flush();
             Msg.Ok.Write(sock);
         }
     }
     catch (Exception)
     {
         Write(Msg.Error);
     }
 }
예제 #4
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)
		{
			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);
 }
예제 #7
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;
		}
예제 #8
0
        public override bool Exists(string path)
        {
            var existingFile = new File(path);

            return(existingFile.Exists() && existingFile.Length() > 0);
        }
예제 #9
0
 public override bool Exists(string path)
 {
     var existingFile = new File(path);
     return existingFile.Exists() && existingFile.Length() > 0;
 }
예제 #10
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);
        }
예제 #11
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;
 }