/[storm]/storm/org/nongnu/storm/impl/p2p/P2PPool.java
ViewVC logotype

Diff of /storm/org/nongnu/storm/impl/p2p/P2PPool.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.9 by benja, Tue May 13 13:44:19 2003 UTC revision 1.10 by benja, Tue May 13 14:40:28 2003 UTC
# Line 68  public class P2PPool extends AbstractLoc Line 68  public class P2PPool extends AbstractLoc
68                  try {                  try {
69                      p("Trying to connect to: " + url);                      p("Trying to connect to: " + url);
70                      URLConnection conn = new URL(url).openConnection();                      URLConnection conn = new URL(url).openConnection();
71                        conn.connect();
72                        for(int x=0;;x++) {
73                            Object o = conn.getHeaderField(x);
74                            if(o == null) break;
75                            p("HF: "+o);
76                        }
77                        p("conn");
78                      String contentType = conn.getContentType();                                  String contentType = conn.getContentType();            
79                        p("gettype");
80                      if(contentType == null) continue;                      if(contentType == null) continue;
81                        p("hastype");
82    
83                      // The content type may contain spaces like this:                      // The content type may contain spaces like this:
84                      // "text/html; charset=utf-8"                      // "text/html; charset=utf-8"
# Line 80  public class P2PPool extends AbstractLoc Line 89  public class P2PPool extends AbstractLoc
89                          contentType = contentType.substring(0, sp) +                          contentType = contentType.substring(0, sp) +
90                                        contentType.substring(sp+1);                                        contentType.substring(sp+1);
91    
92                        p("sp removed");
93                      BlockOutputStream bos =                      BlockOutputStream bos =
94                          cache.getBlockOutputStream(contentType);                          cache.getBlockOutputStream(contentType);
95                        p("bos");
96                      CopyUtil.copy(conn.getInputStream(), bos);                      CopyUtil.copy(conn.getInputStream(), bos);
97                        p("copied");
98                      if(bos.getBlockId().equals(id)) {                      if(bos.getBlockId().equals(id)) {
99                          p("Block found @ " + url);                          p("Block found @ " + url);
100                          return bos.getBlock();                          return bos.getBlock();

Legend:
Removed from v.1.9  
changed lines
  Added in v.1.10

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26