1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154 | package Torello.HTML.Tools.Images;
import java.net.URL;
import Torello.HTML.Tools.Images.Request;
class RequestClone
{
// Used by 'clone()'. This constructor only configures the 'final' fields
static void copy(final Request original, final Request cloned)
{
// Constructor Used by "clone()"
// These fields are 'private' or 'final' - or *OFTEN* both!
//
// private Request(final Request other)
// {
// this.source = other.source;
// this.size = other.size;
// this.counterPrinter = other.counterPrinter
// this.originalPageURL = other.originalPageURL;
// this.b64Images = other.b64Images;
// this.tagNodeSRCExceptions = other.tagNodeSRCExceptions;
//
// this.b64Pos = other.b64Pos;
// this.tnExPos = other.tnExPos;
// }
// private final Iterable<String> source;
// cloned.source = original.source;
// private final int size;
// cloned.size = original.size;
// final IntFunction<String> counterPrinter;
// cloned.counterPrinter = original.counterPrinter;
// public final URL originalPageURL;
// cloned.originalPageURL = original.originalPageURL;
// private final Vector<String[]> b64Images;
// cloned.b64Images = original.b64Images;
// private int b64Pos = 0;
// cloned.b64Pos = original.b64Pos;
// private final Vector<Exception> tagNodeSRCExceptions;
// cloned.tagNodeSRCExceptions = original.tagNodeSRCExceptions;
// private int tnExPos = 0;
// cloned.tnExPos = original.tnExPos;
// *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
// Verbosity & URL-PreProcessor
// *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
// public Verbosity = Verbosity.Normal;
cloned.verbosity = original.verbosity;
// public Function<URL, URL> urlPreProcessor = null;
cloned.urlPreProcessor = original.urlPreProcessor;
// *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
// Location-Decisions for Saving an Image File
// *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
// public Function<ImageInfo, File> targetDirectoryRetriever = null;
cloned.targetDirectoryRetriever = original.targetDirectoryRetriever;
// public Consumer<ImageInfo> imageReceiver = null;
cloned.imageReceiver = original.imageReceiver;
// public String targetDirectory = null;
cloned.targetDirectory = original.targetDirectory;
// *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
// File-Name given to an Image File
// *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
// public String fileNamePrefix = null;
cloned.fileNamePrefix = original.fileNamePrefix;
// public boolean useDefaultCounterForImageFileNames = true;
cloned.useDefaultCounterForImageFileNames = original.useDefaultCounterForImageFileNames;
// public Function<ImageInfo, String> getImageFileSaveName = null;
cloned.getImageFileSaveName = original.getImageFileSaveName;
// *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
// BOOLEAN'S: Which Image Files to Save, and Which to Skip
// *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
// public boolean skipOnDownloadException = false;
cloned.skipOnDownloadException = original.skipOnDownloadException;
// public boolean skipOnB64DecodeException = false;
cloned.skipOnB64DecodeException = original.skipOnB64DecodeException;
// public boolean skipOnTimeOutException = false;
cloned.skipOnTimeOutException = original.skipOnTimeOutException;
// public boolean skipOnNullImageException = false;
cloned.skipOnNullImageException = original.skipOnNullImageException;
// public boolean skipOnImageWritingFail = false;
cloned.skipOnImageWritingFail = original.skipOnImageWritingFail;
// public boolean skipOnUserLambdaException = false;
cloned.skipOnUserLambdaException = original.skipOnUserLambdaException;
// *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
// USER-PREDICATE'S & BOOLEAN'S: Which Image Files to Save, and Which to Skip
// *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
// public Predicate<URL> skipURL = null;
cloned.skipURL = original.skipURL;
// public boolean skipBase64EncodedImages = false;
cloned.skipBase64EncodedImages = original.skipBase64EncodedImages;
// public Predicate<ImageInfo> keeperPredicate = null;
cloned.keeperPredicate = original.keeperPredicate;
// *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
// Avoiding Hangs and Locks with a TimeOut
// *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
// public long maxDownloadWaitTime = 0;
cloned.maxDownloadWaitTime = original.maxDownloadWaitTime;
// public TimeUnit waitTimeUnits = null;
cloned.waitTimeUnits = original.waitTimeUnits;
// *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
// USER AGENT
// *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
// public String userAgent = DEFAULT_USER_AGENT;
cloned.userAgent = original.userAgent;
// public boolean alwaysUseUserAgent = false;
cloned.alwaysUseUserAgent = original.alwaysUseUserAgent;
// public boolean retryWithUserAgent = true;
cloned.retryWithUserAgent = original.retryWithUserAgent;
}
}
|