Produced by Araxis Merge on 3/25/2019 8:58:06 AM Central Daylight Time. See www.araxis.com for information about Merge. This report uses XHTML and CSS2, and is best viewed with a modern standards-compliant browser. For optimum results when printing this report, use landscape orientation and enable printing of background images and colours in your browser.
# | Location | File | Last Modified |
---|---|---|---|
1 | C:\AraxisMergeCompare\Pri_un\IMAG_Source\VISA\Java\VistaConnection\main\src\java\gov\va\med\imaging\url\vista | HandlerFactory.java | Mon Mar 18 20:39:09 2019 UTC |
2 | C:\AraxisMergeCompare\Pri_re\IMAG_Source\VISA\Java\VistaConnection\main\src\java\gov\va\med\imaging\url\vista | HandlerFactory.java | Tue Mar 19 12:04:18 2019 UTC |
Description | Between Files 1 and 2 |
|
---|---|---|
Text Blocks | Lines | |
Unchanged | 2 | 210 |
Changed | 1 | 2 |
Inserted | 0 | 0 |
Removed | 0 | 0 |
Whitespace | |
---|---|
Character case | Differences in character case are significant |
Line endings | Differences in line endings (CR and LF characters) are ignored |
CR/LF characters | Not shown in the comparison detail |
No regular expressions were active.
1 | /** | |
2 | * | |
3 | */ | |
4 | package go v.va.med.i maging.url .vista; | |
5 | ||
6 | import jav a.io.IOExc eption; | |
7 | import jav a.io.Input Stream; | |
8 | import jav a.net.URLS treamHandl er; | |
9 | import jav a.net.URLS treamHandl erFactory; | |
10 | import jav a.util.Has hMap; | |
11 | import jav a.util.Ite rator; | |
12 | import jav a.util.Map ; | |
13 | import jav a.util.Pro perties; | |
14 | ||
15 | /** | |
16 | * @author DN S BECKEC | |
17 | * | |
18 | */ | |
19 | public cla ss Handler Factory | |
20 | implements URLStream HandlerFac tory | |
21 | { | |
22 | // the configura tion mappi ng | |
23 | privat e final st atic Map<S tring, Str ing> handl erClassMap ping; | |
24 | ||
25 | // the loaded (c ached) han dlers | |
26 | privat e final st atic Map<S tring, URL StreamHand ler> handl erMap; | |
27 | ||
28 | static | |
29 | { | |
30 | ha ndlerClass Mapping = new HashMa p<String, String>(); | |
31 | St ring handl erFactoryP roperties = HandlerF actory.cla ss.getName () + ".pro perties"; | |
32 | In putStream inStream = ClassLoad er.getSyst emResource AsStream(h andlerFact oryPropert ies); | |
33 | ||
34 | Sy stem.out.p rintln( | |
35 | (inS tream == n ull ? "Una ble to rea d " : "Rea ding ") + | |
36 | "pro tocol hand ler factor y properti es from '" + | |
37 | hand lerFactory Properties + "'."); | |
38 | ||
39 | Pr operties h andlerClas sMappingPr operties = new Prope rties(); | |
40 | as sert(inStr eam != nul l && handl erClassMap pingProper ties != nu ll); | |
41 | ||
42 | tr y | |
43 | { | |
44 | handlerC lassMappin gPropertie s.load(inS tream); | |
45 | for( Ite rator<Map. Entry<Obje ct, Object >> iter=ha ndlerClass MappingPro perties.en trySet().i terator(); | |
46 | iter .hasNext() ; ) | |
47 | { | |
48 | Map. Entry<Obje ct, Object > entry = iter.next( ); | |
49 | hand lerClassMa pping.put( entry.get Key().toSt ring(), en try.getVal ue().toStr ing() ); | |
50 | } | |
51 | } | |
52 | ca tch (IOExc eption e) | |
53 | { | |
54 | e.printS tackTrace( ); | |
55 | } | |
56 | ||
57 | ha ndlerMap = new HashM ap<String, URLStream Handler>() ; | |
58 | } | |
59 | ||
60 | public HandlerFa ctory() | |
61 | { | |
62 | su per(); | |
63 | } | |
64 | ||
65 | /* (no n-Javadoc) | |
66 | * @se e java.net .URLStream HandlerFac tory#creat eURLStream Handler(ja va.lang.St ring) | |
67 | */ | |
68 | @Overr ide | |
69 | public URLStream Handler cr eateURLStr eamHandler (String pr otocol) | |
70 | { | |
71 | sy nchronized (handlerM ap) | |
72 | { | |
73 | URLStrea mHandler s treamHandl er = handl erMap.get( protocol); | |
74 | if(strea mHandler = = null) | |
75 | { | |
76 | Stri ng handler ClassName = handlerC lassMappin g.get(prot ocol); | |
77 | try | |
78 | { | |
79 | Class<?> h andlerClas s = Class. forName(ha ndlerClass Name); | |
80 | streamHand ler = (URL StreamHand ler)handle rClass.new Instance() ; | |
81 | ||
82 | handlerMap .put(proto col, strea mHandler); | |
83 | } | |
84 | catc h (ClassNo tFoundExce ption e) | |
85 | { | |
86 | e.printSta ckTrace(); | |
87 | } | |
88 | catc h (Instant iationExce ption e) | |
89 | { | |
90 | e.printSta ckTrace(); | |
91 | } | |
92 | catc h (Illegal AccessExce ption e) | |
93 | { | |
94 | e.printSta ckTrace(); | |
95 | } | |
96 | catc h (ClassCa stExceptio n e) | |
97 | { | |
98 | e.printSta ckTrace(); | |
99 | } | |
100 | } | |
101 | ||
102 | return s treamHandl er; | |
103 | } | |
104 | } | |
105 | ||
106 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.