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;
class RequestToString
{
private static final String I4 = " ";
static String toString(final Request r)
{
return
// *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
// Primary Request Fields
// *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
"Primary Request Fields:\n" +
// public final URL originalPageURL;
I4 + "originalPageURL: " + r.originalPageURL + '\n' +
// private final int size;
I4 + "size: " + r.size + '\n' +
// public Verbosity = Verbosity.Normal;
I4 + "Verbosity: " + r.verbosity + '\n' +
'\n' +
// *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
// Location-Decisions for Saving an Image File
// *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
"Location-Decisions for Saving an Image File:\n" +
// public Function<ImageInfo, File> targetDirectoryRetriever = null;
I4 + "targetDirectoryRetriever: " +
OBJ_TO_CLASS_NAME(r.targetDirectoryRetriever) +
// public Consumer<ImageInfo> imageReceiver = null;
I4 + "imageReceiver: " + OBJ_TO_CLASS_NAME(r.imageReceiver) +
// public String targetDirectory = null;
I4 + "targetDirectory: " + ((r.targetDirectory != null)
? ("[\"" + r.targetDirectory + "\"]") : "null") + '\n' +
'\n' +
// *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
// File-Name given to an Image File
// *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
"File-Name given to an Image File:\n" +
// public String fileNamePrefix = null;
I4 + "fileNamePrefix: " + ((r.fileNamePrefix != null)
? ("[\"" + r.fileNamePrefix + "\"]") : "null") + '\n' +
// public boolean useDefaultCounterForImageFileNames = true;
I4 + "useDefaultCounterForImageFileNames: " +
r.useDefaultCounterForImageFileNames + '\n' +
// public Function<ImageInfo, String> getImageFileSaveName = null;
I4 + "getImageFileSaveName: " +
OBJ_TO_CLASS_NAME(r.getImageFileSaveName) + '\n' +
'\n' +
// *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
// BOOLEAN'S: Continuing or Throwing on Failure & Exception
// *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
"Boolean-Flags: Continuing or Throwing on Failure & Exception:\n" +
// public boolean skipOnDownloadException = false;
I4 + "skipOnDownloadException: " + r.skipOnDownloadException + '\n' +
// public boolean skipOnB64DecodeException = false;
I4 + "skipOnB64DecodeException: " + r.skipOnB64DecodeException + '\n' +
// public boolean skipOnTimeOutException = false;
I4 + "skipOnTimeOutException: " + r.skipOnTimeOutException + '\n' +
// public boolean skipOnNullImageException = false;
I4 + "skipOnNullImageException: " + r.skipOnNullImageException + '\n' +
// public boolean skipOnImageWritingFail = false;
I4 + "skipOnImageWritingFail: " + r.skipOnImageWritingFail + '\n' +
// public boolean skipOnUserLambdaException = false;
I4 + "skipOnUserLambdaException: " + r.skipOnUserLambdaException + '\n' +
'\n' +
// *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
// USER-PREDICATE'S & BOOLEAN'S: Which Image Files to Save, and Which to Skip
// *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
"User-Predicate's: Which Image-Files to Save, and Which to Skip:\n" +
// public Predicate<URL> skipURL = null;
I4 + "skipURL: " + OBJ_TO_CLASS_NAME(r.skipURL) +
// public boolean skipBase64EncodedImages = false;
I4 + "skipBase64EncodedImages: " + r.skipBase64EncodedImages + '\n' +
// public Predicate<ImageInfo> keeperPredicate = null;
I4 + "keeperPredicate: " +
OBJ_TO_CLASS_NAME(r.keeperPredicate) +
'\n' +
// *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
// Avoiding Hangs and Locks with a TimeOut
// *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
"Avoiding Hangs and Locks with a TimeOut:\n" +
// public long maxDownloadWaitTime = 0;
I4 + "maxDownloadWaitTime: " + r.maxDownloadWaitTime + '\n' +
// public TimeUnit waitTimeUnits = null;
I4 + "waitTimeUnits: " + r.waitTimeUnits + '\n' +
'\n' +
// *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
// USER AGENT
// *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
"Using a User-Agent:\n" +
// public String userAgent = DEFAULT_USER_AGENT;
I4 + "userAgent: " + r.userAgent + '\n' +
// public boolean alwaysUseUserAgent = false;
I4 + "alwaysUseUserAgent: " + r.alwaysUseUserAgent + '\n' +
// public boolean retryWithUserAgent = true;
I4 + "retryWithUserAgent: " + r.retryWithUserAgent + '\n';
}
private static String OBJ_TO_CLASS_NAME(Object o)
{
if (o == null) return "null\n";
Class<?> c = o.getClass();
return c.isAnonymousClass() ? "Anonymous Class\n" : (c.getName() + '\n');
}
}
|