Forum Stats

  • 3,782,753 Users
  • 2,254,686 Discussions
  • 7,880,153 Comments

Discussions

java.security.AccessControlException: File operation not permitted at GlInterface.zip

Madhavanand
Madhavanand Member Posts: 39 Red Ribbon
edited Aug 11, 2017 4:17AM in Java Cloud Service

Hi,


This is a critical Issue we are facing in builidng application in SaaS extension. Basically we are trying to create a zip file and upload to UCM. In this process we are creating a temp file. This is working fine on local env. But failing on saas extension with policy violation error.

Policy POLICY-ID-427 violated.File operation not permitted at GlInterface.zip

java.security.AccessControlException: File operation not permitted at GlInterface.zip

    at oracle.cloud.jcs.scanning.impl.extension.fileaccess.FileValidatorBase.throwException(FileValidatorBase.java:91)

CODE:

public File getGLZippedDataFile(String requestId,String intType,String docType){
  
    StringBuilder glData = createJournalLines(requestId, intType,docType); 
    File glZip = new File("/tmp/GlInterface.zip");
    ZipOutputStream zos;
    try {
        zos = new ZipOutputStream(new FileOutputStream(glZip));
    ZipEntry glFileName = new ZipEntry("/tmp/GlInterface.csv");
    zos.putNextEntry(glFileName);
    zos.write(glData.toString().getBytes());
    zos.closeEntry();
    zos.close();
    } catch (Exception e) {
    }
    return glZip;

How can we resolve this issue??

Thanks in Advance,

Madhav

Answers

This discussion has been closed.