private Content . Type < ? > getContentType ( String file ) { List < Content . Type < ? > > cts = project . getParent ( ) . getContentTypes ( ) ; for ( int i = 0 ; i != cts . size ( ) ; ++ i ) { Content . Type < ? > ct = cts . get ( i ) ; String suffix = "." + ct . getSuffix ( ) ; if ( file . endsWith ( suffix ) ) { return ct ; } } // Default is just a binary file return Content . BinaryFile ; }
Determine the content type for this file .