protected File getPortFile ( ApplicationContext applicationContext ) { String namespace = getServerNamespace ( applicationContext ) ; if ( StringUtils . isEmpty ( namespace ) ) { return this . file ; } String name = this . file . getName ( ) ; String extension = StringUtils . getFilenameExtension ( this . file . getName ( ) ) ; name = name . substring ( 0 , name . length ( ) - extension . length ( ) - 1 ) ; if ( isUpperCase ( name ) ) { name = name + "-" + namespace . toUpperCase ( Locale . ENGLISH ) ; } else { name = name + "-" + namespace . toLowerCase ( Locale . ENGLISH ) ; } if ( StringUtils . hasLength ( extension ) ) { name = name + "." + extension ; } return new File ( this . file . getParentFile ( ) , name ) ; }
Return the actual port file that should be written for the given application context . The default implementation builds a file from the source file and the application context namespace if available .