Jahia in English > Can't resolve method

0 (0 Good)
0 (0 Bad)

Can't resolve method

by  omglion »  2014/07/14 02:24

Hello, everybody,

I am reading the external exsample codes:

  1. public void saveItem(ExternalData data) throws RepositoryException {
  2. try {
  3. ExtendedNodeType nodeType = NodeTypeRegistry.getInstance().getNodeType(data.getType());
  4. if (nodeType.isNodeType(Constants.NT_RESOURCE)) {
  5. OutputStream outputStream = null;
  6. try {
  7. final Binary[] binaries = data.getBinaryProperties().get(Constants.JCR_DATA);
  8. if (binaries.length > 0) {
  9. outputStream = getFile(data.getPath().substring(0, data.getPath().indexOf("/" + Constants.JCR_CONTENT))).getContent().getOutputStream();
  10. for (Binary binary : binaries) {
  11. InputStream stream = null;
  12. try {
  13. stream = binary.getStream();
  14. IOUtils.copy(stream, outputStream);
  15. } finally {
  16. IOUtils.closeQuietly(stream);
  17. binary.dispose();
  18. }
  19. }
  20. }
  21. } catch (IOException e) {
  22. throw new PathNotFoundException("I/O on file : " + data.getPath(),e);
  23. } catch (RepositoryException e) {
  24. throw new PathNotFoundException("unable to get outputStream of : " + data.getPath(),e);
  25. } finally {
  26. IOUtils.closeQuietly(outputStream);
  27. }
  28. } else if (nodeType.isNodeType("jnt:folder")) {
  29. try {
  30. getFile(data.getPath()).createFolder();
  31. } catch (FileSystemException e) {
  32. throw new PathNotFoundException(e);
  33. }
  34. }
  35. } catch (NoSuchNodeTypeException e) {
  36. throw new PathNotFoundException(e);
  37. }
  38. }

Could you please tell me the dependecies that i shoud add into pom.xml?

Now I can not resolve the method getFile(....), getContent at line 9.

Thanks.

Kindly regards

Lion

 

 

 

  (omglion)

Number of messages  27
Registration date
0 (0 Good)
0 (0 Bad)

Re: Can't resolve method

by  qlamerand »  2014/11/26 12:55

Hello,
This seems to be an excerpt from VFSDataSource (for the external data provider used to mount a folder from the file system in the JCR).
The getFile method is defined in the same class.
You can see it here : https://github.com/Jahia/external-provider/blob/master/vfs/src/main/java/org/jahia/modules/external/vfs/VFSDataSource.java
Regards,
Quentin

  • Re: Can't resolve method
    2014/11/26 12:55

    qlamerand <p>Hello,<br /> This seems to be an excerpt&nbsp;from VFSDataSource (for the external data provider used to mount a folder from the file system in the JCR).<br /> The getFile method is defined in the same class.<br /> You can see it here :&nbsp;<a href="https://github.com/Jahia/external-provider/blob/master/vfs/src/main/java/org/jahia/modules/external/vfs/VFSDataSource.java">https://github.com/Jahia/external-provider/blob/master/vfs/src/main/java/org/jahia/modules/external/vfs/VFSDataSource.java</a><br /> Regards,<br /> Quentin</p>

  • Number of messages  28
    Registration date Nov 26, 2014
    Contact
    Share
    Feedback

    Get in touch

    Whether you are a current user or if you are just evaluating Jahia, we are here to help.

    Contact us

    Share this page