library: libCore #include "TWebFile.h"

# TWebFile

class description - source file - inheritance tree (.ps)

## class TWebFile : public TFile

| Inheritance Chart:

`TObject`

<-

`TNamed`

<-

`TDirectory`

<-

`TFile`

<-

`TWebFile`

        private:

                   TWebFile()
              void Init(Bool_t)

        public:

                           TWebFile(const char* url)
                           TWebFile(TUrl url)
                   virtual ~TWebFile()
            static TClass* Class()
          virtual Long64_t GetSize() const
           virtual TClass* IsA() const
            virtual Bool_t IsOpen() const
            virtual Bool_t ReadBuffer(char* buf, Int_t len)
             virtual Int_t ReOpen(Option_t* mode)
              virtual void Seek(Long64_t offset, TFile::ERelativeTo pos = kBeg)
              virtual void ShowMembers(TMemberInspector& insp, char* parent)
              virtual void Streamer(TBuffer& b)
                      void StreamerNVirtual(TBuffer& b)

### Data Members

        private:

              TUrl fUrl     URL of file
          Long64_t fOffset  seek offset

## Class Description

     TWebFile

     A TWebFile is like a normal TFile except that it reads its data
     via a (slightly modified) apache web server. A TWebFile is a
     read-only file.

TWebFile(const char *url) : TFile(url, "WEB"), fUrl(url)

     Create a Web file object. A web file is the same as a read-only
     TFile except that it is being read via a HTTP server. The url
     argument must be of the form: http://host.dom.ain/file.root.
     If the file specified in the URL does not exist or is not accessible
     the kZombie bit will be set in the TWebFile object. Use IsZombie()
     to see if the file is accessible. The preferred interface to this
     constructor is via TFile::Open().

TWebFile(TUrl url) : TFile(url.GetUrl(), "WEB"), fUrl(url)

     Create a Web file object. A web file is the same as a read-only
     TFile except that it is being read via a HTTP server. Make sure url
     is a valid TUrl object.
     If the file specified in the URL does not exist or is not accessible
     the kZombie bit will be set in the TWebFile object. Use IsZombie()
     to see if the file is accessible.

void Init(Bool_t)

     Initialize a TWebFile object.

Bool_t IsOpen() const

     A TWebFile that has been correctly constructed is always considered open.

Int_t ReOpen(Option_t *mode)

     Reopen a file with a different access mode, like from READ to
     UPDATE or from NEW, CREATE, RECREATE, UPDATE to READ. Thus the
     mode argument can be either "READ" or "UPDATE". The method returns
     0 in case the mode was successfully modified, 1 in case the mode
     did not change (was already as requested or wrong input arguments)
     and -1 in case of failure, in which case the file cannot be used
     anymore. A TWebFile cannot be reopened in update mode.

Bool_t ReadBuffer(char *buf, Int_t len)

     Read specified byte range from remote file via HTTP daemon. This
     routine connects to the remote host, sends the request and returns
     the buffer. Returns kTRUE in case of error.

void Seek(Long64_t offset, ERelativeTo pos)

     Set position from where to start reading.

Long64_t GetSize() const

     Return maximum file size to by-pass truncation checking.

### Inline Functions

                   void ~TWebFile()
               TWebFile TWebFile(TUrl url)
                TClass* Class()
                TClass* IsA() const
                   void ShowMembers(TMemberInspector& insp, char* parent)
                   void Streamer(TBuffer& b)
                   void StreamerNVirtual(TBuffer& b)

Author: Fons Rademakers 17/01/97
Last update: root/net:$Name: $:$Id: TWebFile.cxx,v 1.8 2004/01/03 09:38:54 brun Exp $
Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *