@Override public Path save( final Path path, final ProcessNode content, final Metadata metadata, final String comment) { try { ioService.write( Paths.convert(path), BpmnPersistence.getInstance().marshal(content), MetadataFactory.makeMetadata(metadata), CommentedOptionFactory.makeCommentedOption(identity, sessionInfo, comment)); return path; } catch (Exception e) { throw ExceptionUtilities.handleException(e); } }
@Override public Path create( final Path context, final String fileName, final ProcessNode content, final String comment) { try { final org.uberfire.java.nio.file.Path nioPath = Paths.convert(context).resolve(fileName); final Path newPath = Paths.convert(nioPath); if (ioService.exists(nioPath)) { throw new FileAlreadyExistsException(nioPath.toString()); } ioService.write( nioPath, BpmnPersistence.getInstance().marshal(content), CommentedOptionFactory.makeCommentedOption(identity, sessionInfo, comment)); return newPath; } catch (Exception e) { throw ExceptionUtilities.handleException(e); } }