/[classpath]/classpath/gnu/xml/transform/XSLURIResolver.java
ViewVC logotype

Diff of /classpath/gnu/xml/transform/XSLURIResolver.java

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

revision 1.2 by gnu_andrew, Sat Feb 12 14:26:02 2005 UTC revision 1.3 by dog, Sat May 14 21:43:43 2005 UTC
# Line 134  class XSLURIResolver Line 134  class XSLURIResolver
134                    }                    }
135                }                }
136            }            }
137          if (in == null && url != null)          if (in == null)
138            {            {
139              systemId = url.toString();              if (url != null)
             node = (Node) nodeCache.get(systemId);  
             // Is the resource up to date?  
             URLConnection conn = url.openConnection();  
             Long llm = (Long) lastModifiedCache.get(systemId);  
             if (llm != null)  
               {  
                 lastLastModified = llm.longValue();  
                 conn.setIfModifiedSince(lastLastModified);  
               }  
             conn.connect();  
             lastModified = conn.getLastModified();  
             if (node != null &&  
                 lastModified > 0L &&  
                 lastModified <= lastLastModified)  
140                {                {
141                  // Resource unchanged                  systemId = url.toString();
142                  return new DOMSource(node, systemId);                  node = (Node) nodeCache.get(systemId);
143                    // Is the resource up to date?
144                    URLConnection conn = url.openConnection();
145                    Long llm = (Long) lastModifiedCache.get(systemId);
146                    if (llm != null)
147                      {
148                        lastLastModified = llm.longValue();
149                        conn.setIfModifiedSince(lastLastModified);
150                      }
151                    conn.connect();
152                    lastModified = conn.getLastModified();
153                    if (node != null &&
154                        lastModified > 0L &&
155                        lastModified <= lastLastModified)
156                      {
157                        // Resource unchanged
158                        return new DOMSource(node, systemId);
159                      }
160                    else
161                      {
162                        // Resource new or modified
163                        in = conn.getInputStream();
164                        nodeCache.put(systemId, node);
165                        lastModifiedCache.put(systemId, new Long(lastModified));
166                      }
167                }                }
168              else              else
169                {                {
170                  // Resource new or modified                  throw new TransformerException("can't resolve URL: " +
171                  in = conn.getInputStream();                                                 systemId);
                 nodeCache.put(systemId, node);  
                 lastModifiedCache.put(systemId, new Long(lastModified));  
172                }                }
173            }            }
174          InputSource input = new InputSource(in);          InputSource input = new InputSource(in);
# Line 207  class XSLURIResolver Line 215  class XSLURIResolver
215                {                {
216                  url = new URL(href);                  url = new URL(href);
217                }                }
218                else
219                  {
220                    // See below
221                    throw new MalformedURLException(systemId);
222                  }
223            }            }
224          return url;          return url;
225        }        }

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

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