|
|
| 893 |
917 |
|
| 311 | 311 | mLoadedPage = null;
|
| 312 | 312 | }
|
| 313 | 313 |
|
| 314 | | private GZip loadFile(String fileName) {
|
| 315 | | File fp = new File(fileName);
|
| 314 | private GZip loadFile(File fp) {
|
| 316 | 315 | GZip localZip = new GZip();
|
| 317 | 316 |
|
| 318 | 317 | if(fp.exists()) {
|
| --- | --- | |
| 322 | 321 | JConfig.log().logDebug("Loading from backing page (file is " + fp.length() + " bytes)!");
|
| 323 | 322 | localZip.load(fp);
|
| 324 | 323 | } catch(IOException ioe) {
|
| 325 | | JConfig.log().handleException("Couldn't read " + fileName, ioe);
|
| 324 | JConfig.log().handleException("Couldn't read " + fp.getName(), ioe);
|
| 326 | 325 | return null;
|
| 327 | 326 | }
|
| 328 | 327 |
|
| 329 | 328 | return localZip;
|
| 330 | 329 | } else {
|
| 331 | | JConfig.log().logDebug("Can't load " + fileName + ", file is too large.");
|
| 330 | JConfig.log().logDebug("Can't load " + fp.getName() + ", file is too large.");
|
| 332 | 331 | }
|
| 333 | 332 | }
|
| 334 | 333 | return null;
|
| --- | --- | |
| 359 | 358 | }
|
| 360 | 359 |
|
| 361 | 360 | GZip getRealContent() {
|
| 361 | File fp = getContentFile();
|
| 362 | if(fp != null) return loadFile(fp);
|
| 363 | return mLoadedPage;
|
| 364 | }
|
| 365 |
|
| 366 | File getContentFile() {
|
| 367 | File fp = null;
|
| 362 | 368 | String outPath = JConfig.queryConfiguration("auctions.savepath");
|
| 363 | 369 | if(outPath != null && outPath.length() != 0) {
|
| 364 | 370 | String filePath = outPath + System.getProperty("file.separator") + getIdentifier() + ".html.gz";
|
| 365 | 371 | JConfig.log().logDebug("filePath = " + filePath);
|
| 366 | | return loadFile(filePath);
|
| 372 | fp = new File(filePath);
|
| 367 | 373 | }
|
| 368 | | return mLoadedPage;
|
| 374 | return fp;
|
| 369 | 375 | }
|
| 370 | 376 |
|
| 371 | 377 | public void setContent(StringBuffer inContent, boolean final_data) {
|