private String [ ] canonicalise ( final String [ ] xaResInfoClasspath ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "canonicalise" , xaResInfoClasspath ) ; final String [ ] result ; if ( xaResInfoClasspath != null ) { final ArrayList < String > al = new ArrayList < String > ( ) ; for ( final String pathElement : xaResInfoClasspath ) { if ( pathElement != null ) { String cp ; try { cp = ( String ) TMHelper . runAsSystem ( new PrivilegedExceptionAction < String > ( ) { public String run ( ) throws Exception { String path = ( new File ( pathElement ) ) . getCanonicalPath ( ) ; //@D656080A if ( ! ( new File ( path ) ) . exists ( ) ) path = null ; //@D656080A return path ; //@D656080C } } ) ; } catch ( Throwable t ) { FFDCFilter . processException ( t , "com.ibm.ws.Transaction.JTA.XARecoveryWrapper.canonicalise" , "512" , this ) ; // can't do much else than .... cp = pathElement ; } if ( cp != null ) al . add ( cp ) ; // @D656080C } } if ( al . size ( ) > 0 ) // @D656080A { // @D656080A result = al . toArray ( new String [ al . size ( ) ] ) ; } // @D656080A else // @D656080A { // @D656080A result = null ; // @D656080A } // @D656080A } else { result = null ; } if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "canonicalise" , result ) ; return result ; }
Canonicalise inbound paths so they can be compared with paths held in the classloaders