-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Expand file tree
/
Copy pathConfig.java
More file actions
966 lines (811 loc) · 26.5 KB
/
Config.java
File metadata and controls
966 lines (811 loc) · 26.5 KB
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
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
package xdman;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.ArrayDeque;
import xdman.util.Logger;
import xdman.util.StringUtils;
import xdman.util.XDMUtils;
public class Config {
private boolean forceSingleFolder;
private boolean monitoring = true;
private String metadataFolder;
private String temporaryFolder;
private String downloadFolder;
private String dataFolder;
private int sortField;
private boolean sortAsc;
private int categoryFilter;
private int stateFilter;
private String searchText;
private int maxSegments;
private int minSegmentSize;
private int speedLimit; // in kb/sec
private boolean showDownloadWindow;
private boolean showDownloadCompleteWindow;
private int parallalDownloads;
private boolean autoShutdown;
private int duplicateAction;
private boolean quietMode;
private String[] blockedHosts, vidUrls, fileExts, vidExts, vidMime;
private String[] defaultFileTypes, defaultVideoTypes;
private int networkTimeout, tcpWindowSize;
private int proxyMode;// 0 no-proxy,1 pac, 2 http, 3 socks
private String proxyPac, proxyHost, socksHost;
private int proxyPort, socksPort;
private String proxyUser, proxyPass;
private boolean showVideoNotification;
private int minVidSize;
private boolean keepAwake, execCmd, execAntivir, autoStart;
private String customCmd, antivirCmd, antivirExe;
private boolean firstRun;
private String language;
private boolean monitorClipboard;
private String categoryOther, categoryDocuments, categoryMusic, categoryVideos, categoryPrograms,
categoryCompressed;
private boolean downloadAutoStart;
private boolean fetchTs;
private boolean noTransparency;
private boolean hideTray;
private String lastFolder;
private final int maxRecentFoldersCount = 5;
private ArrayDeque<String> recentFolders;
private List<MonitoringListener> listeners;
private String queueIdFilter;
private boolean showVideoListOnlyInBrowser;
private int zoomLevelIndex = 0;
public void addConfigListener(MonitoringListener listener) {
listeners.add(listener);
}
public String getLanguage() {
return language;
}
public void setLanguage(String language) {
this.language = language;
}
public void save() {
FileWriter fw = null;
try {
File file = new File(System.getProperty("user.home"), ".xdman/config.txt");
fw = new FileWriter(file);
String newLine = "\n";
fw.write("monitoring:" + this.monitoring + newLine);
fw.write("downloadFolder:" + this.downloadFolder + newLine);
fw.write("temporaryFolder:" + this.temporaryFolder + newLine);
fw.write("parallalDownloads:" + this.parallalDownloads + newLine);
fw.write("maxSegments:" + this.maxSegments + newLine);
fw.write("networkTimeout:" + this.networkTimeout + newLine);
fw.write("tcpWindowSize2:" + this.tcpWindowSize + newLine);
fw.write("minSegmentSize2:" + this.minSegmentSize + newLine);
fw.write("minVidSize:" + this.minVidSize + newLine);
fw.write("duplicateAction:" + this.duplicateAction + newLine);
fw.write("speedLimit:" + this.speedLimit + newLine);
fw.write("showDownloadWindow:" + this.showDownloadWindow + newLine);
fw.write("showDownloadCompleteWindow:" + this.showDownloadCompleteWindow + newLine);
fw.write("blockedHosts:" + XDMUtils.appendArray2Str(this.blockedHosts) + newLine);
fw.write("vidUrls:" + XDMUtils.appendArray2Str(this.vidUrls) + newLine);
fw.write("fileExts:" + XDMUtils.appendArray2Str(this.fileExts) + newLine);
fw.write("vidExts:" + XDMUtils.appendArray2Str(this.vidExts) + newLine);
fw.write("proxyMode:" + this.proxyMode + newLine);
fw.write("proxyPac:" + this.proxyPac + newLine);
fw.write("proxyHost:" + this.proxyHost + newLine);
fw.write("proxyPort:" + this.proxyPort + newLine);
fw.write("socksHost:" + this.socksHost + newLine);
fw.write("socksPort:" + this.socksPort + newLine);
fw.write("proxyUser:" + this.proxyUser + newLine);
fw.write("proxyPass:" + this.proxyPass + newLine);
fw.write("autoShutdown:" + this.autoShutdown + newLine);
fw.write("keepAwake:" + this.keepAwake + newLine);
fw.write("execCmd:" + this.execCmd + newLine);
fw.write("execAntivir:" + this.execAntivir + newLine);
fw.write("version:" + XDMApp.APP_VERSION + newLine);
fw.write("autoStart:" + this.autoStart + newLine);
fw.write("language:" + this.language + newLine);
fw.write("downloadAutoStart:" + this.downloadAutoStart + newLine);
if (!StringUtils.isNullOrEmptyOrBlank(this.antivirExe))
fw.write("antivirExe:" + this.antivirExe + newLine);
if (!StringUtils.isNullOrEmptyOrBlank(this.antivirCmd))
fw.write("antivirCmd:" + this.antivirCmd + newLine);
if (!StringUtils.isNullOrEmptyOrBlank(this.customCmd))
fw.write("customCmd:" + this.customCmd + newLine);
fw.write("showVideoNotification:" + this.showVideoNotification + newLine);
fw.write("monitorClipboard:" + this.monitorClipboard + newLine);
if (!StringUtils.isNullOrEmptyOrBlank(this.categoryOther))
fw.write("categoryOther:" + this.categoryOther + newLine);
if (!StringUtils.isNullOrEmptyOrBlank(this.categoryCompressed))
fw.write("categoryCompressed:" + this.categoryCompressed + newLine);
if (!StringUtils.isNullOrEmptyOrBlank(this.categoryDocuments))
fw.write("categoryDocuments:" + this.categoryDocuments + newLine);
if (!StringUtils.isNullOrEmptyOrBlank(this.categoryMusic))
fw.write("categoryMusic:" + this.categoryMusic + newLine);
if (!StringUtils.isNullOrEmptyOrBlank(this.categoryVideos))
fw.write("categoryVideos:" + this.categoryVideos + newLine);
if (!StringUtils.isNullOrEmptyOrBlank(this.categoryPrograms))
fw.write("categoryPrograms:" + this.categoryPrograms + newLine);
fw.write("fetchTs:" + this.fetchTs + newLine);
fw.write("noTransparency:" + this.noTransparency + newLine);
fw.write("forceSingleFolder:" + this.forceSingleFolder + newLine);
fw.write("hideTray:" + this.hideTray + newLine);
if (lastFolder != null) {
fw.write("lastFolder:" + this.lastFolder + newLine);
}
writeRecentFoldersToFile(fw);
fw.write("showVideoListOnlyInBrowser:" + this.showVideoListOnlyInBrowser + newLine);
fw.write("zoomLevelIndex:" + this.zoomLevelIndex + newLine);
} catch (Exception e) {
}
try {
if (fw != null)
fw.close();
} catch (Exception e) {
}
}
public void load() {
Logger.log("Loading config...");
BufferedReader br = null;
try {
File file = new File(System.getProperty("user.home"), ".xdman/config.txt");
if (!file.exists()) {
return;
}
FileReader r = new FileReader(file);
br = new BufferedReader(r);
while (true) {
String ln = br.readLine();
if (ln == null)
break;
if (ln.startsWith("#"))
continue;
int index = ln.indexOf(":");
if (index < 1)
continue;
String key = ln.substring(0, index);
String val = ln.substring(index + 1);
if (key.equals("monitoring")) {
this.monitoring = val.equals("true");
} else if (key.equals("downloadFolder")) {
this.downloadFolder = val;
} else if (key.equals("temporaryFolder")) {
this.temporaryFolder = val;
} else if (key.equals("maxSegments")) {
this.maxSegments = Integer.parseInt(val);
} else if (key.equals("minSegmentSize2")) {
this.minSegmentSize = Integer.parseInt(val);
} else if (key.equals("networkTimeout")) {
this.networkTimeout = Integer.parseInt(val);
} else if (key.equals("tcpWindowSize2")) {
this.tcpWindowSize = Integer.parseInt(val);
} else if (key.equals("duplicateAction")) {
this.duplicateAction = Integer.parseInt(val);
} else if (key.equals("speedLimit")) {
this.speedLimit = Integer.parseInt(val);
} else if (key.equals("showDownloadWindow")) {
this.showDownloadWindow = val.equals("true");
} else if (key.equals("showDownloadCompleteWindow")) {
this.showDownloadCompleteWindow = val.equals("true");
} else if (key.equals("downloadAutoStart")) {
this.downloadAutoStart = val.equals("true");
} else if (key.equals("minVidSize")) {
this.minVidSize = Integer.parseInt(val);
} else if (key.equals("parallalDownloads")) {
this.parallalDownloads = Integer.parseInt(val);
} else if (key.equals("blockedHosts")) {
this.blockedHosts = val.split(",");
} else if (key.equals("vidUrls")) {
this.vidUrls = val.split(",");
} else if (key.equals("fileExts")) {
this.fileExts = val.split(",");
} else if (key.equals("vidExts")) {
this.vidExts = val.split(",");
} else if (key.equals("proxyMode")) {
this.proxyMode = Integer.parseInt(val);
} else if (key.equals("proxyPort")) {
this.proxyPort = Integer.parseInt(val);
} else if (key.equals("socksPort")) {
this.socksPort = Integer.parseInt(val);
} else if (key.equals("proxyPac")) {
this.proxyPac = val;
} else if (key.equals("proxyHost")) {
this.proxyHost = val;
} else if (key.equals("socksHost")) {
this.socksHost = val;
} else if (key.equals("proxyUser")) {
this.proxyUser = val;
} else if (key.equals("proxyPass")) {
this.proxyPass = val;
} else if (key.equals("showVideoNotification")) {
this.showVideoNotification = "true".equals(val);
} else if (key.equals("keepAwake")) {
this.keepAwake = "true".equals(val);
} else if (key.equals("autoStart")) {
this.autoStart = "true".equals(val);
} else if (key.equals("execAntivir")) {
this.execAntivir = "true".equals(val);
} else if (key.equals("execCmd")) {
this.execCmd = "true".equals(val);
} else if (key.equals("antivirExe")) {
this.antivirExe = val;
} else if (key.equals("antivirCmd")) {
this.antivirCmd = val;
} else if (key.equals("customCmd")) {
this.customCmd = val;
} else if (key.equals("autoShutdown")) {
this.autoShutdown = "true".equals(val);
} else if (key.equals("version")) {
this.firstRun = !XDMApp.APP_VERSION.equals(val);
} else if (key.equals("language")) {
this.language = val;
} else if (key.equals("monitorClipboard")) {
this.monitorClipboard = "true".equals(val);
} else if (key.equals("categoryOther")) {
this.categoryOther = val;
} else if (key.equals("categoryDocuments")) {
this.categoryDocuments = val;
} else if (key.equals("categoryCompressed")) {
this.categoryCompressed = val;
} else if (key.equals("categoryMusic")) {
this.categoryMusic = val;
} else if (key.equals("categoryVideos")) {
this.categoryVideos = val;
} else if (key.equals("categoryPrograms")) {
this.categoryPrograms = val;
} else if (key.equals("fetchTs")) {
this.fetchTs = "true".equals(val);
} else if (key.equals("noTransparency")) {
this.noTransparency = "true".equals(val);
} else if (key.equals("forceSingleFolder")) {
this.forceSingleFolder = "true".equals(val);
} else if (key.equals("hideTray")) {
this.hideTray = "true".equals(val);
} else if (key.equals("lastFolder")) {
this.lastFolder = val;
} else if (key.equals("showVideoListOnlyInBrowser")) {
this.showVideoListOnlyInBrowser = "true".equals(val);
} else if (key.equals("zoomLevelIndex")) {
this.zoomLevelIndex = Integer.parseInt(val);
}
else if (key.equals("recentFolders")){
readRecentFoldersFromFile(val);
}
}
} catch (Exception e) {
Logger.log(e);
} finally {
if (!forceSingleFolder) {
createFolders();
}
try {
br.close();
} catch (Exception e) {
}
}
}
private static Config _config;
private Config() {
forceSingleFolder = false;
File f = new File(System.getProperty("user.home"), ".xdman");
if (!f.exists()) {
f.mkdirs();
}
dataFolder = f.getAbsolutePath();
f = new File(dataFolder, "metadata");
if (!f.exists()) {
f.mkdir();
}
this.metadataFolder = f.getAbsolutePath();
f = new File(dataFolder, "temp");
if (!f.exists()) {
f.mkdir();
}
this.temporaryFolder = f.getAbsolutePath();
// System.setProperty("sun.java2d.uiScale.enabled", "true");
// System.setProperty("sun.java2d.uiScale", "2.75");// String.format("%.2f", zoom));
this.downloadFolder = XDMUtils.getDownloadsFolder();
if (!new File(this.downloadFolder).exists()) {
File file = new File(System.getProperty("user.home"), "Downloads");
file.mkdirs();
this.downloadFolder = file.getAbsolutePath();
}
this.monitoring = true;
this.showDownloadWindow = true;
this.setMaxSegments(8);
this.setMinSegmentSize(256 * 1024);
this.parallalDownloads = 100;
this.minVidSize = 1 * 1024 * 1024;
this.defaultFileTypes = new String[] { "3GP", "7Z", "AVI", "BZ2", "DEB", "DOC", "DOCX", "EXE", "GZ", "ISO",
"MSI", "PDF", "PPT", "PPTX", "RAR", "RPM", "XLS", "XLSX", "SIT", "SITX", "TAR", "JAR", "ZIP", "XZ" };
this.fileExts = defaultFileTypes;
this.autoShutdown = false;
this.blockedHosts = new String[] { "update.microsoft.com", "windowsupdate.com", "thwawte.com" };
this.defaultVideoTypes = new String[] { "MP4", "M3U8", "F4M", "WEBM", "OGG", "MP3", "AAC", "FLV", "MKV", "DIVX",
"MOV", "MPG", "MPEG", "OPUS" };
this.vidExts = defaultVideoTypes;
this.vidUrls = new String[] { ".facebook.com|pagelet", "player.vimeo.com/", "instagram.com/p/" };
this.vidMime = new String[] { "video/", "audio/", "mpegurl", "f4m", "m3u8" };
this.networkTimeout = 60;
this.tcpWindowSize = 0;
this.speedLimit = 0;
this.proxyMode = 0;
this.proxyPort = 0;
this.socksPort = 0;
this.proxyPac = this.proxyHost = this.proxyUser = this.proxyPass = this.socksHost = "";
this.showVideoNotification = true;
this.showDownloadCompleteWindow = true;
this.firstRun = true;
this.language = "en";
this.monitorClipboard = false;
this.noTransparency = false;
this.hideTray = true;
this.listeners = new ArrayList<>();
this.recentFolders = new ArrayDeque<>();
}
public void createFolders() {
Logger.log("Creating folders");
getCategoryDocuments();
getCategoryMusic();
getCategoryCompressed();
getCategoryPrograms();
getCategoryVideos();
}
private void writeRecentFoldersToFile(FileWriter fw)
{
if (recentFolders.isEmpty())
return;
try
{
fw.write("recentFolders:");
for (String recentFolder : recentFolders)
{
fw.write(recentFolder + ",");
}
fw.write("\n");
}
catch (Exception e)
{
Logger.log(e);
}
}
private void readRecentFoldersFromFile(String val)
{
String[] folders = val.split(",");
for (String folder: folders)
this.recentFolders.addLast(folder);
}
public static synchronized Config getInstance() {
if (_config == null) {
_config = new Config();
}
return _config;
}
public final String getMetadataFolder() {
return metadataFolder;
}
public final String getTemporaryFolder() {
return temporaryFolder;
}
public final String getDataFolder() {
return dataFolder;
}
public int getX() {
return -1;
}
public int getY() {
return -1;
}
public int getWidth() {
return -1;
}
public int getHeight() {
return -1;
}
public boolean getSortAsc() {
return sortAsc;
}
public void setSortAsc(boolean sortAsc) {
this.sortAsc = sortAsc;
}
public boolean isBrowserMonitoringEnabled() {
return monitoring;
}
public void enableMonitoring(boolean enable) {
monitoring = enable;
for (MonitoringListener mon : listeners) {
if (mon != null) {
mon.configChanged();
}
}
}
public int getSortField() {
return sortField;
}
public void setSortField(int sortField) {
this.sortField = sortField;
}
public int getCategoryFilter() {
return categoryFilter;
}
public void setCategoryFilter(int categoryFilter) {
this.categoryFilter = categoryFilter;
}
public int getStateFilter() {
return stateFilter;
}
public void setStateFilter(int stateFilter) {
this.stateFilter = stateFilter;
}
public String getSearchText() {
return searchText;
}
public void setSearchText(String searchText) {
this.searchText = searchText;
}
public String getDownloadFolder() {
return downloadFolder;
}
public void setDownloadFolder(String downloadFolder) {
this.downloadFolder = downloadFolder;
}
public int getMaxSegments() {
return maxSegments;
}
public void setMaxSegments(int maxSegments) {
this.maxSegments = maxSegments;
}
public int getMinSegmentSize() {
return minSegmentSize;
}
public void setMinSegmentSize(int minSegmentSize) {
this.minSegmentSize = minSegmentSize;
}
public final int getSpeedLimit() {
return speedLimit;
}
public final void setSpeedLimit(int speedLimit) {
this.speedLimit = speedLimit;
}
public final boolean showDownloadWindow() {
return showDownloadWindow;
}
public final void setShowDownloadWindow(boolean show) {
this.showDownloadWindow = show;
}
public final int getMaxDownloads() {
return parallalDownloads;
}
public final void setMaxDownloads(int maxDownloads) {
this.parallalDownloads = maxDownloads;
}
public final boolean isAutoShutdown() {
return autoShutdown;
}
public final void setAutoShutdown(boolean autoShutdown) {
this.autoShutdown = autoShutdown;
}
public String[] getBlockedHosts() {
return blockedHosts;
}
public void setBlockedHosts(String[] blockedHosts) {
this.blockedHosts = blockedHosts;
}
public String[] getVidUrls() {
return vidUrls;
}
public void setVidUrls(String[] vidUrls) {
this.vidUrls = vidUrls;
}
public String[] getFileExts() {
return fileExts;
}
public void setFileExts(String[] fileExts) {
this.fileExts = fileExts;
}
public String[] getVidExts() {
return vidExts;
}
public void setVidExts(String[] vidExts) {
this.vidExts = vidExts;
}
public final boolean showDownloadCompleteWindow() {
return showDownloadCompleteWindow;
}
public final int getDuplicateAction() {
return duplicateAction;
}
public final void setDuplicateAction(int duplicateAction) {
this.duplicateAction = duplicateAction;
}
public boolean isQuietMode() {
return quietMode;
}
public void setQuietMode(boolean quietMode) {
this.quietMode = quietMode;
}
public final void setShowDownloadCompleteWindow(boolean show) {
this.showDownloadCompleteWindow = show;
}
public final String[] getDefaultFileTypes() {
return defaultFileTypes;
}
public final void setDefaultFileTypes(String[] defaultFileTypes) {
this.defaultFileTypes = defaultFileTypes;
}
public final String[] getDefaultVideoTypes() {
return defaultVideoTypes;
}
public final void setDefaultVideoTypes(String[] defaultVideoTypes) {
this.defaultVideoTypes = defaultVideoTypes;
}
public final int getNetworkTimeout() {
return networkTimeout;
}
public final void setNetworkTimeout(int networkTimeout) {
this.networkTimeout = networkTimeout;
}
public final int getTcpWindowSize() {
return tcpWindowSize;
}
public final void setTcpWindowSize(int tcpWindowSize) {
this.tcpWindowSize = tcpWindowSize;
}
public final int getProxyMode() {
return proxyMode;
}
public final void setProxyMode(int proxyMode) {
this.proxyMode = proxyMode;
}
public final String getProxyUser() {
return proxyUser;
}
public final void setProxyUser(String proxyUser) {
this.proxyUser = proxyUser;
}
public final String getProxyPass() {
return proxyPass;
}
public final void setProxyPass(String proxyPass) {
this.proxyPass = proxyPass;
}
public final String getProxyPac() {
return proxyPac;
}
public final void setProxyPac(String proxyPac) {
this.proxyPac = proxyPac;
}
public final String getProxyHost() {
return proxyHost;
}
public final void setProxyHost(String proxyHost) {
this.proxyHost = proxyHost;
}
public final int getProxyPort() {
return proxyPort;
}
public final void setProxyPort(int proxyPort) {
this.proxyPort = proxyPort;
}
public boolean isShowVideoNotification() {
return showVideoNotification;
}
public void setShowVideoNotification(boolean showVideoNotification) {
this.showVideoNotification = showVideoNotification;
}
public int getMinVidSize() {
return minVidSize;
}
public void setMinVidSize(int minVidSize) {
this.minVidSize = minVidSize;
}
public String getSocksHost() {
return socksHost;
}
public void setSocksHost(String socksHost) {
this.socksHost = socksHost;
}
public int getSocksPort() {
return socksPort;
}
public void setSocksPort(int socksPort) {
this.socksPort = socksPort;
}
public boolean isKeepAwake() {
return keepAwake;
}
public void setKeepAwake(boolean keepAwake) {
this.keepAwake = keepAwake;
}
public boolean isExecCmd() {
return execCmd;
}
public void setExecCmd(boolean execCmd) {
this.execCmd = execCmd;
}
public boolean isExecAntivir() {
return execAntivir;
}
public void setExecAntivir(boolean execAntivir) {
this.execAntivir = execAntivir;
}
public boolean isAutoStart() {
return autoStart;
}
public void setAutoStart(boolean autoStart) {
this.autoStart = autoStart;
}
public String getCustomCmd() {
return customCmd;
}
public void setCustomCmd(String customCmd) {
this.customCmd = customCmd;
}
public String getAntivirCmd() {
return antivirCmd;
}
public void setAntivirCmd(String antivirCmd) {
this.antivirCmd = antivirCmd;
}
public String getAntivirExe() {
return antivirExe;
}
public void setAntivirExe(String antivirExe) {
this.antivirExe = antivirExe;
}
public boolean isFirstRun() {
return firstRun;
}
public boolean isMonitorClipboard() {
return monitorClipboard;
}
public void setMonitorClipboard(boolean monitorClipboard) {
this.monitorClipboard = monitorClipboard;
}
public void addBlockedHosts(String host) {
List<String> list = new ArrayList<String>(Arrays.asList(blockedHosts));
if (list.contains(host)) {
return;
}
list.add(host);
blockedHosts = list.toArray(new String[list.size()]);
}
public String getCategoryOther() {
if (this.categoryOther == null) {
this.categoryOther = getDownloadFolder();
}
return categoryOther;
}
public void setCategoryOther(String categoryOther) {
this.categoryOther = categoryOther;
}
public String getCategoryDocuments() {
if (this.categoryDocuments == null) {
File folder = new File(getDownloadFolder(), "Documents");
folder.mkdirs();
this.categoryDocuments = folder.getAbsolutePath();
}
return categoryDocuments;
}
public void setCategoryDocuments(String categoryDocuments) {
this.categoryDocuments = categoryDocuments;
}
public String getCategoryMusic() {
if (this.categoryMusic == null) {
File folder = new File(getDownloadFolder(), "Music");
folder.mkdirs();
this.categoryMusic = folder.getAbsolutePath();
}
return categoryMusic;
}
public void setCategoryMusic(String categoryMusic) {
this.categoryMusic = categoryMusic;
}
public String getCategoryVideos() {
if (this.categoryVideos == null) {
File folder = new File(getDownloadFolder(), "Video");
folder.mkdirs();
this.categoryVideos = folder.getAbsolutePath();
}
return categoryVideos;
}
public void setTemporaryFolder(String folder) {
this.temporaryFolder = folder;
}
public void setCategoryVideos(String categoryVideos) {
this.categoryVideos = categoryVideos;
}
public String getCategoryPrograms() {
if (this.categoryPrograms == null) {
File folder = new File(getDownloadFolder(), "Programs");
folder.mkdirs();
this.categoryPrograms = folder.getAbsolutePath();
}
return categoryPrograms;
}
public void setCategoryPrograms(String categoryPrograms) {
this.categoryPrograms = categoryPrograms;
}
public String getCategoryCompressed() {
if (this.categoryCompressed == null) {
File folder = new File(getDownloadFolder(), "Compressed");
folder.mkdirs();
this.categoryCompressed = folder.getAbsolutePath();
}
return categoryCompressed;
}
public void setCategoryCompressed(String categoryCompressed) {
this.categoryCompressed = categoryCompressed;
}
public boolean isDownloadAutoStart() {
return downloadAutoStart;
}
public void setDownloadAutoStart(boolean downloadAutoStart) {
this.downloadAutoStart = downloadAutoStart;
}
public boolean isFetchTs() {
return fetchTs;
}
public void setFetchTs(boolean fetchTs) {
this.fetchTs = fetchTs;
}
public boolean isNoTransparency() {
return noTransparency;
}
public void setNoTransparency(boolean noTransparency) {
this.noTransparency = noTransparency;
}
public boolean isForceSingleFolder() {
return forceSingleFolder;
}
public void setForceSingleFolder(boolean forceSingleFolder) {
this.forceSingleFolder = forceSingleFolder;
}
public boolean isHideTray() {
return hideTray;
}
public void setHideTray(boolean hideTray) {
this.hideTray = hideTray;
}
public String getLastFolder() {
return lastFolder;
}
public ArrayDeque<String> getRecentFolders()
{
return recentFolders;
}
public void setLastFolder(String lastFolder) {
this.lastFolder = lastFolder;
updateRecentFolders(lastFolder);
}
private void updateRecentFolders(String lastFolder)
{
if (recentFolders.size() == maxRecentFoldersCount)
recentFolders.removeLast();
recentFolders.addFirst(lastFolder);
}
public String getQueueIdFilter() {
return queueIdFilter;
}
public void setQueueIdFilter(String queueIdFilter) {
this.queueIdFilter = queueIdFilter;
}
public boolean isShowVideoListOnlyInBrowser() {
return showVideoListOnlyInBrowser;
}
public void setShowVideoListOnlyInBrowser(boolean showVideoListOnlyInBrowser) {
this.showVideoListOnlyInBrowser = showVideoListOnlyInBrowser;
}
public String[] getVidMime() {
return vidMime;
}
public void setVidMime(String[] vidMime) {
this.vidMime = vidMime;
}
public int getZoomLevelIndex() {
return zoomLevelIndex;
}
public void setZoomLevelIndex(int zoomLevelIndex) {
this.zoomLevelIndex = zoomLevelIndex;
}
}