[mjava.nio.file.NoSuchFileException: /NFS_DATA/transfert/transfer_d3/incoming/hotfolders/interfaces/hostfile/export/78103052.20180810143433
Я пытаюсь предоставить групповые права доступа к файлу в системе Unix. Я получаю файл с помощью fileUtils, а затем пытаюсь установить разрешение на него, получая путь к этому файлу. Код выглядит следующим образом:
this.output = FileUtils.getFile("/NFS_DATA/transfert/transfer_d3/incoming/hotfolders/interfaces/hostfile/export/78103052.20180810143433");
Set<PosixFilePermission> perms = new HashSet<PosixFilePermission>();
//add owners permission
perms.add(PosixFilePermission.OWNER_READ);
perms.add(PosixFilePermission.OWNER_WRITE);
//add group permissions
perms.add(PosixFilePermission.GROUP_READ);
perms.add(PosixFilePermission.GROUP_WRITE);
Files.setPosixFilePermissions(this.output.toPath(), perms);
Тем не менее, я получаю ниже исключения при установке разрешений:
[mjava.nio.file.NoSuchFileException: /NFS_DATA/transfert/transfer_d3/incoming/hotfolders/interfaces/hostfile/export/78103052.20180810143433
at sun.nio.fs.UnixException.translateToIOException(UnixException.java:86)
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)
at sun.nio.fs.UnixFileAttributeViews$Posix.setMode(UnixFileAttributeViews.java:240)
at sun.nio.fs.UnixFileAttributeViews$Posix.setPermissions(UnixFileAttributeViews.java:262)
at java.nio.file.Files.setPosixFilePermissions(Files.java:2045)
at au.com.metcash.integration.utils.HostFileWriter.createHostTxtFile(HostFileWriter.java:48)
at au.com.metcash.integration.utils.HostFileWriter.<init>(HostFileWriter.java:35)
at au.com.metcash.integration.cronjob.HostFileDeltaCreationJob.lambda$22(HostFileDeltaCreationJob.java:487)
at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184)
at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:175)
at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:175)
at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:175)
at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:175)
at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1374)
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151)
at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174)
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:418)
at au.com.metcash.integration.cronjob.HostFileDeltaCreationJob.generateFilesForRecords(HostFileDeltaCreationJob.java:475)
at au.com.metcash.integration.cronjob.HostFileDeltaCreationJob.generateDeltaForRetailer(HostFileDeltaCreationJob.java:233)
at au.com.metcash.integration.cronjob.HostFileDeltaCreationJob.perform(HostFileDeltaCreationJob.java:132)
at au.com.metcash.integration.cronjob.HostFileDeltaCreationJob.perform(HostFileDeltaCreationJob.java:1)
at de.hybris.platform.servicelayer.internal.jalo.ServicelayerJob.performCronJob(ServicelayerJob.java:38)
at de.hybris.platform.cronjob.jalo.Job.execute(Job.java:1390)
at de.hybris.platform.cronjob.jalo.Job.performImpl(Job.java:814)
at de.hybris.platform.cronjob.jalo.Job.access$1(Job.java:767)
at de.hybris.platform.cronjob.jalo.Job$JobRunable.run(Job.java:686)
at de.hybris.platform.util.threadpool.PoolableThread.internalRun(PoolableThread.java:208)
at de.hybris.platform.core.threadregistry.RegistrableThread.run(RegistrableThread.java:135)
Пожалуйста, помогите исправить это.