bundleBuilder.overwriteAclSettings( overwriteAclSettingsFlag );
bundleBuilder.retainOwnership( retainOwnershipFlag );
bundleBuilder.name( fileName );
IPlatformImportBundle bundle = bundleBuilder.build();
IPlatformImportMimeResolver mimeResolver = PentahoSystem.get( IPlatformImportMimeResolver.class );
String mimeTypeFromFile = mimeResolver.resolveMimeForFileName( fileName );
if ( mimeTypeFromFile == null ) {
return Response.ok( "INVALID_MIME_TYPE", MediaType.TEXT_HTML ).build();
}
bundleBuilder.mime( mimeTypeFromFile );
IPlatformImporter importer = PentahoSystem.get( IPlatformImporter.class );
importLogger = importer.getRepositoryImportLogger();
final String mimeType =
bundle.getMimeType() != null ? bundle.getMimeType() : mimeResolver.resolveMimeForBundle( bundle );
if ( mimeType == null ) {
return Response.ok( "INVALID_MIME_TYPE", MediaType.TEXT_HTML ).build();
}
logJobStarted = true;