We have an issue with the performance of writing the file to the filesystem(Document.Save()) after we deploy it to our cloud environment (where some java security is applied).
The file generation and saving is locally (without emulating cloud security 2-3 sec) and in the cloud (with the security rules below) 10-12 seconds.
Does anyone have experience to solve this problem?
Security policy:
ALLOW {
[org.osgi.service.condpermadmin.BundleLocationCondition “project.jar"]
(java.util.PropertyPermission "com.ctc.wstx.” “read”)
(org.osgi.framework.AdminPermission “" "” )
(org.osgi.framework.PackagePermission “" “exportonly,import” )
(org.osgi.framework.ServicePermission "” “get,register”)
(org.osgi.framework.BundlePermission “" “provide,require, host,fragment”)
(org.osgi.service.event.TopicPermission "” “publish,subscribe”)
(java.lang.reflect.ReflectPermission “suppressAccessChecks”)
(java.lang.RuntimePermission “accessClassInPackage.com.sun.org.apache.xerces.internal." “”)
(java.lang.RuntimePermission “accessClassInPackage.sun.misc” “”)
(java.lang.RuntimePermission “accessDeclaredMembers”)
(java.lang.RuntimePermission “getProtectionDomain”)
(java.lang.RuntimePermission “getClassLoader”)
(java.lang.RuntimePermission “modifyThread” “”)
(java.lang.RuntimePermission “setContextClassLoader”)
(java.lang.RuntimePermission “setFactory”)
(java.io.FilePermission “{DeploymentDir}/data/tmp/-” “read,write,delete,execute”)
(java.io.FilePermission “{DeploymentDir}/model/resources/-” “read”)
(java.io.FilePermission “{DeploymentDir}/model/lib/-” “read”)
(java.net.NetPermission “getProxySelector” “”)
(java.net.NetPermission “specifyStreamHandler” “”)
(java.security.SecurityPermission “insertProvider.BC” “”)
(java.security.SecurityPermission “putProviderProperty.BC” “”)
(java.util.logging.LoggingPermission “control” “”)
(java.util.PropertyPermission “com.google.gdata.DisableCookieHandler” “read”)
(java.util.PropertyPermission “com.sun.jersey.core.util.ReaderWriter.BufferSize” “read”)
(java.util.PropertyPermission “com.sun.xml.fastinfoset.parser.buffer-size” “read”)
(java.util.PropertyPermission “com.sun.xml.fastinfoset.parser.string-interning” “read”)
(java.util.PropertyPermission “com.sun.xml.fastinfoset.serializer.character-encoding-scheme” “read”)
(java.util.PropertyPermission “file.encoding” “read”)
(java.util.PropertyPermission “file.separator” “read”)
(java.util.PropertyPermission “glyphlist_ext” “read”)
(java.util.PropertyPermission “HSSFRow.ColInitialCapacity” “read”)
(java.util.PropertyPermission “HSSFSheet.RowInitialCapacity” “read”)
(java.util.PropertyPermission “HSSFWorkbook.SheetInitialCapacity” “read”)
(java.util.PropertyPermission “hornetq.version.property.filename” “read”)
(java.util.PropertyPermission “http.strictPostRedirect” “read”)
(java.util.PropertyPermission “https.cipherSuites” “read”)
(java.util.PropertyPermission “https.protocols” “read”)
(java.util.PropertyPermission “Oracle Java Technologies | Oracle” “read”)
(java.util.PropertyPermission "ical4j.” “read,write”)
(java.util.PropertyPermission “imgscalr." “read,write”)
(java.util.PropertyPermission “java.home” “read”)
(java.util.PropertyPermission “java.io.tmpdir” “read,write”)
(java.util.PropertyPermission “java.protocol.handler.pkgs” “read, write”)
(java.util.PropertyPermission “java.specification.version” “read”)
(java.util.PropertyPermission “java.vendor” “read”)
(java.util.PropertyPermission “java.vendor.url” “read”)
(java.util.PropertyPermission “java.version” “read”)
(java.util.PropertyPermission “java.vm.name” “read”)
(java.util.PropertyPermission “java.vm.vendor” “read”)
(java.util.PropertyPermission “java.vm.version” “read”)
(java.util.PropertyPermission “javax.net.ssl.keyStore” “write”)
(java.util.PropertyPermission “javax.net.ssl.keyStorePassword” “read,write”)
(java.util.PropertyPermission “javax.net.ssl.trustStore” “read,write”)
(java.util.PropertyPermission “javax.net.ssl.trustStorePassword” “read,write”)
(java.util.PropertyPermission “jco.destinations.dir” “read”)
(java.util.PropertyPermission “line.separator” “read,write”)
(java.util.PropertyPermission “mail.smtp.auth” “read,write”)
(java.util.PropertyPermission “mail.smtp.host” “read,write”)
(java.util.PropertyPermission “mail.smtp.password” “read,write”)
(java.util.PropertyPermission “mail.smtp.port” “read,write”)
(java.util.PropertyPermission “mail.smtp.starttls.enable” “read,write”)
(java.util.PropertyPermission “mail.smtp.user” “read,write”)
(java.util.PropertyPermission “mapAnyUriToUri” “read”)
(java.util.PropertyPermission “mustache.compile” “read,write”)
(java.util.PropertyPermission “mustache.debug” “read,write”)
(java.util.PropertyPermission “nd.org.xml.sax.parser read” “read,write”)
(java.util.PropertyPermission “nd.org.xml.sax.parser” “read,write”)
(java.util.PropertyPermission "net.fortuna.” “read,write”)
(java.util.PropertyPermission “org.apache." “read,write”)
(java.util.PropertyPermission “org.bouncycastle.pkcs1.strict” “read”)
(java.util.PropertyPermission “org.glassfish.web.rfc2109_cookie_names_enforced” “read”)
(java.util.PropertyPermission “org.hornetq.opt.directblast” “read”)
(java.util.PropertyPermission “org.hornetq.ssl.keyStoreProvider” “read”)
(java.util.PropertyPermission “org.hornetq.ssl.trustStoreProvider” “read”)
(java.util.PropertyPermission "org.imgscalr.” “read,write”)
(java.util.PropertyPermission “org.jboss.netty.debug” “read”)
(java.util.PropertyPermission “org.springframework." “read write”)
(java.util.PropertyPermission "org.owasp.” “read,write”)
(java.util.PropertyPermission “org.xml.sax.parser” “read,write”)
(java.util.PropertyPermission “os.arch” “read”)
(java.util.PropertyPermission “os.name” “read”)
(java.util.PropertyPermission “os.version” “read”)
(java.util.PropertyPermission “path.separator” “read”)
(java.util.PropertyPermission “pdftextstripper.drop” “read”)
(java.util.PropertyPermission “pdftextstripper.indent” “read”)
(java.util.PropertyPermission “poi.keep.tmp.files” “read,write”)
(java.util.PropertyPermission “saaj.lazy.contentlength” “read”)
(java.util.PropertyPermission “ssl.KeyManagerFactory.algorithm” “read,write”)
(java.util.PropertyPermission “smack.disabledClasses” “read,write”)
(java.util.PropertyPermission “smack.provider.file” “read,write”)
(java.util.PropertyPermission “sun.arch.data.model” “read,write”)
(java.util.PropertyPermission “twitter4j.http.httpClient” “read,write”)
(java.util.PropertyPermission “twitter4j.loggerFactory” “read,write”)
(java.util.PropertyPermission “user.dir” “read”)
(java.util.PropertyPermission “webdriver.remote.shorten_log_messages” “read”)
(java.net.SocketPermission “*” “connect, accept”)
(java.net.SocketPermission “localhost:0” “listen,resolve”)
(javax.xml.bind.JAXBPermission “setDatatypeConverter”)
(org.bouncycastle.jce.ProviderConfigurationPermission “BC” “ecImplicitlyCA, threadLocalEcImplicitlyCA”)
} “Permissions for the project bundle”
ALLOW {
[org.osgi.service.condpermadmin.BundleLocationCondition “*project.jar” “!”]
(java.security.AllPermission)
} “AllPermission to everything except project bundle”