private static String getResourceNameFromUri ( final URI resourceAddress , final boolean usePathStyleUris , final String error ) { Utility . assertNotNull ( "resourceAddress" , resourceAddress ) ; final String [ ] pathSegments = resourceAddress . getRawPath ( ) . split ( "/" ) ; final int expectedPartsLength = usePathStyleUris ? 3 : 2 ; if ( pathSegments . length < expectedPartsLength ) { throw new IllegalArgumentException ( error ) ; } final String resourceName = usePathStyleUris ? pathSegments [ 2 ] : pathSegments [ 1 ] ; return Utility . trimEnd ( resourceName , ' ' ) ; }
Get the container queue or table name from address from the URI .