s3 = Aws::S3::Resource.new(region:'us-east-1')
obj = s3.bucket("bucket-name").object("filename.json", acl:'public-read')
obj.put(body: objects.to_json)
除权限外,上述代码按预期工作。当我查看它们时,当我需要将它们设置为public时,读取权限将设置为“所有者”。
答案 0 :(得分:0)
此代码中存在语法问题,您必须在得分下使用,而不是为了权限而使用。请使用public_read
代替public-read
s3 = Aws::S3::Resource.new(region:'us-east-1')
obj = s3.bucket("bucket-name").object("filename.json", acl:'public_read')
obj.put(body: objects.to_json)
答案 1 :(得分:0)
[2016-07-08T21:20:15.226+0200] [glassfish 4.1] [SEVERE] [NCLS-CORE-00026] [javax.enterprise.system.core] [tid: _ThreadID=22 _ThreadName=RunLevelControllerThread-1468005611695] [timeMillis: 1468005615226] [levelValue: 1000] [[
Exception during lifecycle processing
java.lang.IllegalArgumentException: Specified library jar android-7.jar does not exist: /opt/glassfish4/glassfish/domains/domain1/lib/android-7.jar
at org.glassfish.deployment.common.DeploymentContextImpl.getAppLibs(DeploymentContextImpl.java:458)
at org.glassfish.deployment.common.DeploymentContextImpl.createClassLoader(DeploymentContextImpl.java:244)
at org.glassfish.deployment.common.DeploymentContextImpl.createDeploymentClassLoader(DeploymentContextImpl.java:229)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:365)
at com.sun.enterprise.v3.server.ApplicationLoaderService.processApplication(ApplicationLoaderService.java:406)
at com.sun.enterprise.v3.server.ApplicationLoaderService.postConstruct(ApplicationLoaderService.java:243)
at org.jvnet.hk2.internal.ClazzCreator.postConstructMe(ClazzCreator.java:329)
at org.jvnet.hk2.internal.ClazzCreator.create(ClazzCreator.java:377)
at org.jvnet.hk2.internal.SystemDescriptor.create(SystemDescriptor.java:461)
at org.glassfish.hk2.runlevel.internal.AsyncRunLevelContext.findOrCreate(AsyncRunLevelContext.java:227)
at org.glassfish.hk2.runlevel.RunLevelContext.findOrCreate(RunLevelContext.java:84)
at org.jvnet.hk2.internal.Utilities.createService(Utilities.java:2258)
at org.jvnet.hk2.internal.ServiceHandleImpl.getService(ServiceHandleImpl.java:105)
at org.jvnet.hk2.internal.ServiceHandleImpl.getService(ServiceHandleImpl.java:87)
at org.glassfish.hk2.runlevel.internal.CurrentTaskFuture$QueueRunner.oneJob(CurrentTaskFuture.java:1162)
at org.glassfish.hk2.runlevel.internal.CurrentTaskFuture$QueueRunner.run(CurrentTaskFuture.java:1147)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
]]
原来我在错误的位置调用它