33 class TWebFile :
public TFile {
35 friend class TWebSocket;
36 friend class TWebSystem;
39 TWebFile() : fSocket(0) { }
42 mutable Long64_t fSize;
48 TString fMsgReadBuffer;
49 TString fMsgReadBuffer10;
55 Long64_t fFullCacheSize;
58 static Long64_t fgMaxFullCacheSize;
60 virtual void Init(Bool_t readHeadOnly);
61 virtual void CheckProxy();
62 virtual TString BasicAuthentication();
63 virtual Int_t GetHead();
64 virtual Int_t GetLine(TSocket *s,
char *line, Int_t maxsize);
65 virtual Int_t GetHunk(TSocket *s,
char *hunk, Int_t maxsize);
66 virtual const char *HttpTerminator(
const char *start,
const char *peeked, Int_t peeklen);
67 virtual Int_t GetFromWeb(
char *buf, Int_t len,
const TString &msg);
68 virtual Int_t GetFromWeb10(
char *buf, Int_t len,
const TString &msg, Int_t nseg = 0, Long64_t *seg_pos = 0, Int_t *seg_len = 0);
69 virtual Int_t GetFromCache(
char *buf, Int_t len, Int_t nseg, Long64_t *seg_pos, Int_t *seg_len);
70 virtual Bool_t ReadBuffer10(
char *buf, Int_t len);
71 virtual Bool_t ReadBuffers10(
char *buf, Long64_t *pos, Int_t *len, Int_t nbuf);
72 virtual void SetMsgReadBuffer10(
const char *redirectLocation = 0, Bool_t tempRedirect = kFALSE);
73 virtual void ProcessHttpHeader(
const TString& headerLine);
76 TWebFile(
const char *url, Option_t *opt=
"");
77 TWebFile(TUrl url, Option_t *opt=
"");
80 virtual Long64_t GetSize()
const;
81 virtual Bool_t IsOpen()
const;
82 virtual Int_t ReOpen(Option_t *mode);
83 virtual Bool_t ReadBuffer(
char *buf, Int_t len);
84 virtual Bool_t ReadBuffer(
char *buf, Long64_t pos, Int_t len);
85 virtual Bool_t ReadBuffers(
char *buf, Long64_t *pos, Int_t *len, Int_t nbuf);
86 virtual void Seek(Long64_t offset, ERelativeTo pos = kBeg);
88 static void SetProxy(
const char *url);
89 static const char *GetProxy();
91 static Long64_t GetMaxFullCacheSize();
92 static void SetMaxFullCacheSize(Long64_t sz);
98 class TWebSystem :
public TSystem {
103 void *GetDirPtr()
const {
return fDirp; }
107 virtual ~TWebSystem() { }
109 Int_t MakeDirectory(
const char *name);
110 void *OpenDirectory(
const char *name);
111 void FreeDirectory(
void *dirp);
112 const char *GetDirEntry(
void *dirp);
113 Int_t GetPathInfo(
const char *path, FileStat_t &buf);
114 Bool_t AccessPathName(
const char *path, EAccessMode mode);
115 Int_t Unlink(
const char *path);
117 ClassDef(TWebSystem,0)