Repository full path

StaryVena
StaryVena New Altair Community Member
edited November 5 in Community Q&A
Hi,
can anybody help me, how to get full path of actual repository. I would like to make operator similar to Retrieve, that can open image with relative path in repository. I already figured out how to get path in repository,.
Thank you for replies.

Vena

Answers

  • fischer
    fischer New Altair Community Member
    Hi,

    you mean the file on disk? No way. There is not necessarily a file behind it.

    Cheers,
    Simon
  • radone
    radone New Altair Community Member
    Hello,
    I guess you are dealing with problem of reading a file from repository. To do so you probably need to extend the
    class YourClass extends AbstractReader<YourIOObject> { ... }
    and also you will need to register reader description

    class YourClass extends AbstractReader<YourIOObject> {
          static {
    AbstractReader.registerReaderDescription(new ReaderDescription("txt",
    YourClass.class, PARAMETER_FILENAME));
    }
    ...
    }
    Then the:
    getParameterAsFile(fileName);
    should search also in local repositories.

    Unfortunately I had to miss something because it does not work for me  :(.

    If you find a solution I would be really interested.
  • fischer
    fischer New Altair Community Member
    Hi,

    once again: The API of Repositories has nothing to do with files. Repository entries are not necessarily files. Therefore, if you want to operate on repositories, getParameterAsFile() will be of absolutely zero use. It returnes a File and knows nothing about repositories.

    But if you want to store or retrieve images from the repository, you can use blobs. Repositories can contain processes, ioobjects, and blobs. So you take the RepositoryLocation, locate (or create) the corresponding entry, and cast it to BlobEntry. You can then store binary image date.

    Best,
    Simon