作業部屋の使い方を試しています。
InputStream読込み追加
@@ -26,6 +26,7 @@ | ||
26 | 26 | import java.io.FileNotFoundException; |
27 | 27 | import java.io.FileOutputStream; |
28 | 28 | import java.io.IOException; |
29 | +import java.io.InputStream; | |
29 | 30 | import java.util.logging.Level; |
30 | 31 | import java.util.logging.Logger; |
31 | 32 |
@@ -137,6 +138,16 @@ | ||
137 | 138 | } |
138 | 139 | } |
139 | 140 | |
141 | + public void read(InputStream is) { | |
142 | + try { | |
143 | + readdoc = builder.parse(is); | |
144 | + xmlroot = readdoc.getDocumentElement(); | |
145 | + | |
146 | + } catch (SAXException | IOException ex) { | |
147 | + Logger.getLogger(LibraryXml.class.getName()).log(Level.SEVERE, null, ex); | |
148 | + } | |
149 | + } | |
150 | + | |
140 | 151 | /* ---------------------------------------------------------------------- */ |
141 | 152 | |
142 | 153 | } |
@@ -24,6 +24,7 @@ | ||
24 | 24 | |
25 | 25 | import webScraping.core.SearchData; |
26 | 26 | import java.io.File; |
27 | +import java.io.InputStream; | |
27 | 28 | import java.util.ArrayList; |
28 | 29 | import org.w3c.dom.Element; |
29 | 30 | import org.w3c.dom.Node; |
@@ -133,6 +134,11 @@ | ||
133 | 134 | elementget(); |
134 | 135 | } |
135 | 136 | |
137 | + public void load(InputStream is) { | |
138 | + xlib.read(is); | |
139 | + elementget(); | |
140 | + } | |
141 | + | |
136 | 142 | public void elementget() { |
137 | 143 | root = xlib.getreadRoot(rootnameScraping); |
138 | 144 | elementgetUrl(); |