Produced by Araxis Merge on 12/5/2017 12:06:42 PM Central Standard 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 | IV-eHMP_CIF.zip\IMAG_Source\VISA\Java\ImageGearConnection\main\src\java\gov\va\med\imaging\url\imagegear | HandlerFactory.java | Mon Dec 4 21:35:08 2017 UTC |
| 2 | IV-eHMP_CIF.zip\IMAG_Source\VISA\Java\ImageGearConnection\main\src\java\gov\va\med\imaging\url\imagegear | HandlerFactory.java | Mon Dec 4 22:01:09 2017 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 3 | 252 |
| Changed | 2 | 4 |
| 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 | Package: MAG - Vis tA Imaging | |
| 4 | WARNING: Per VHA D irective 2 004-038, t his routin e should n ot be modi fied. | |
| 5 | Date Cre ated: Feb 28, 2008 | |
| 6 | Site Nam e: Washin gton OI Fi eld Office , Silver S pring, MD | |
| 7 | Developer:
|
|
| 8 | Descript ion: | |
| 9 | ||
| 10 | ;; +-------- ---------- ---------- ---------- ---------- ---------- ---------- + | |
| 11 | ;; Property of the US Government . | |
| 12 | ;; No permis sion to co py or redi stribute t his softwa re is give n. | |
| 13 | ;; Use of un released v ersions of this soft ware requi res the us er | |
| 14 | ;; to execu te a writt en test ag reement wi th the Vis tA Imaging | |
| 15 | ;; Developm ent Office of the De partment o f Veterans Affairs, | |
| 16 | ;; telephon e (301) 73 4-0100. | |
| 17 | ;; | |
| 18 | ;; The Food and Drug A dministrat ion classi fies this software a s | |
| 19 | ;; a Class I I medical device. A s such, it may not b e changed | |
| 20 | ;; in any wa y. Modifi cations to this soft ware may r esult in a n | |
| 21 | ;; adulterat ed medical device un der 21CFR8 20, the us e of which | |
| 22 | ;; is consid ered to be a violati on of US F ederal Sta tutes. | |
| 23 | ;; +-------- ---------- ---------- ---------- ---------- ---------- ---------- + | |
| 24 | ||
| 25 | */ | |
| 26 | package go v.va.med.i maging.url .imagegear ; | |
| 27 | ||
| 28 | import jav a.io.IOExc eption; | |
| 29 | import jav a.io.Input Stream; | |
| 30 | import jav a.net.URLS treamHandl er; | |
| 31 | import jav a.net.URLS treamHandl erFactory; | |
| 32 | import jav a.util.Has hMap; | |
| 33 | import jav a.util.Ite rator; | |
| 34 | import jav a.util.Map ; | |
| 35 | import jav a.util.Pro perties; | |
| 36 | ||
| 37 | /** | |
| 38 | * @author
|
|
| 39 | * | |
| 40 | */ | |
| 41 | public cla ss Handler Factory | |
| 42 | implements URLStream HandlerFac tory | |
| 43 | { | |
| 44 | // the configura tion mappi ng | |
| 45 | privat e final st atic Map<S tring, Str ing> handl erClassMap ping; | |
| 46 | ||
| 47 | // the loaded (c ached) han dlers | |
| 48 | privat e final st atic Map<S tring, URL StreamHand ler> handl erMap; | |
| 49 | ||
| 50 | static | |
| 51 | { | |
| 52 | ha ndlerClass Mapping = new HashMa p<String, String>(); | |
| 53 | St ring handl erFactoryP roperties = HandlerF actory.cla ss.getName () + ".pro perties"; | |
| 54 | In putStream inStream = ClassLoad er.getSyst emResource AsStream(h andlerFact oryPropert ies); | |
| 55 | ||
| 56 | Sy stem.out.p rintln( | |
| 57 | (inS tream == n ull ? "Una ble to rea d " : "Rea ding ") + | |
| 58 | "pro tocol hand ler factor y properti es from '" + | |
| 59 | hand lerFactory Properties + "'."); | |
| 60 | ||
| 61 | Pr operties h andlerClas sMappingPr operties = new Prope rties(); | |
| 62 | as sert(inStr eam != nul l && handl erClassMap pingProper ties != nu ll); | |
| 63 | ||
| 64 | tr y | |
| 65 | { | |
| 66 | handlerC lassMappin gPropertie s.load(inS tream); | |
| 67 | for( Ite rator<Map. Entry<Obje ct, Object >> iter=ha ndlerClass MappingPro perties.en trySet().i terator(); | |
| 68 | iter .hasNext() ; ) | |
| 69 | { | |
| 70 | Map. Entry<Obje ct, Object > entry = iter.next( ); | |
| 71 | hand lerClassMa pping.put( entry.get Key().toSt ring(), en try.getVal ue().toStr ing() ); | |
| 72 | } | |
| 73 | } | |
| 74 | ca tch (IOExc eption e) | |
| 75 | { | |
| 76 | e.printS tackTrace( ); | |
| 77 | } | |
| 78 | ||
| 79 | ha ndlerMap = new HashM ap<String, URLStream Handler>() ; | |
| 80 | } | |
| 81 | ||
| 82 | public HandlerFa ctory() | |
| 83 | { | |
| 84 | su per(); | |
| 85 | } | |
| 86 | ||
| 87 | /* (no n-Javadoc) | |
| 88 | * @se e java.net .URLStream HandlerFac tory#creat eURLStream Handler(ja va.lang.St ring) | |
| 89 | */ | |
| 90 | @Overr ide | |
| 91 | public URLStream Handler cr eateURLStr eamHandler (String pr otocol) | |
| 92 | { | |
| 93 | sy nchronized (handlerM ap) | |
| 94 | { | |
| 95 | URLStrea mHandler s treamHandl er = handl erMap.get( protocol); | |
| 96 | if(strea mHandler = = null) | |
| 97 | { | |
| 98 | Stri ng handler ClassName = handlerC lassMappin g.get(prot ocol); | |
| 99 | try | |
| 100 | { | |
| 101 | Class<?> h andlerClas s = Class. forName(ha ndlerClass Name); | |
| 102 | streamHand ler = (URL StreamHand ler)handle rClass.new Instance() ; | |
| 103 | ||
| 104 | handlerMap .put(proto col, strea mHandler); | |
| 105 | } | |
| 106 | catc h (ClassNo tFoundExce ption e) | |
| 107 | { | |
| 108 | e.printSta ckTrace(); | |
| 109 | } | |
| 110 | catc h (Instant iationExce ption e) | |
| 111 | { | |
| 112 | e.printSta ckTrace(); | |
| 113 | } | |
| 114 | catc h (Illegal AccessExce ption e) | |
| 115 | { | |
| 116 | e.printSta ckTrace(); | |
| 117 | } | |
| 118 | catc h (ClassCa stExceptio n e) | |
| 119 | { | |
| 120 | e.printSta ckTrace(); | |
| 121 | } | |
| 122 | } | |
| 123 | ||
| 124 | return s treamHandl er; | |
| 125 | } | |
| 126 | } | |
| 127 | ||
| 128 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.