Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8644935
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T12:25:18+00:00 2026-06-12T12:25:18+00:00

In my jackrabbit datastore there are large binary files stored. I can browse the

  • 0

In my jackrabbit datastore there are large binary files stored.
I can browse the datastore filesystem and open these files without any problems.

Now how can I use these files from within my application? I of course could use the
getStream() method of type jcr.binary but then I would just stream all the content of the already exsisting file into a new temporary file right? Since my binarys are very large I don’t want that. I’m looking for a way to get the full filesystem path of a binary. The method
getpath() of jcr.Property only returns the path within the repository and only with the mapped node names and not the node names which are really stored on my filesystem. In general I have to parse a binary object into a Java.IO.File object and I want to avoid Streaming

Edit: Through reflection I saw that the class of my binary is
class org.apache.jackrabbit.core.value.BLOBInDataStore I guess I have to somehow access the File value from there

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T12:25:19+00:00Added an answer on June 12, 2026 at 12:25 pm

    I was right when saying that reflection could be of help. Here’s my code which returns the physical filepath of a binary stored in a jackrabbit datastore :

    public String getPhysicalBinaryPath(Binary b){
        try {
            Field idField=b.getClass().getDeclaredField("identifier");
            idField.setAccessible(true);
            String identifier = (String)idField.get(b).toString();
            Field storeField=b.getClass().getDeclaredField("store");
            storeField.setAccessible(true);
            Object store = storeField.get(b);
            Field pathField = store.getClass().getDeclaredField("path");
            pathField.setAccessible(true);
            String dataStorePath = (String)pathField.get(store);
    
            String binaryPath = identifier.substring(0,2)+File.separator+
                                identifier.substring(2,4)+File.separator+
                                identifier.substring(4,6)+File.separator+
                                identifier;
    
            return dataStorePath+File.separator+binaryPath;
    
        } catch (IllegalArgumentException ex) {
            Logger.getLogger(Repoutput.class.getName()).log(Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            Logger.getLogger(Repoutput.class.getName()).log(Level.SEVERE, null, ex);
        } catch (NoSuchFieldException ex) {
            Logger.getLogger(Repoutput.class.getName()).log(Level.SEVERE, null, ex);
        } catch (SecurityException ex) {
            Logger.getLogger(Repoutput.class.getName()).log(Level.SEVERE, null, ex);
        }
    
            return "";
    
    
    }
    

    Edit: This is the official way to do it (you’ll have to use the jackrabbit-api)

    Binary b = session.getValueFactory().createBinary(in);
    Value value = session.getValueFactory().createValue(b);
      if (value instanceof JackrabbitValue) {
       JackrabbitValue jv = (JackrabbitValue) value;
       String id = jv.getContentIdentity();
      }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there a way that I can configure custom node types for Apache Jackrabbit
I'm configuring Jackrabbit 2.3.6 and I need to index binary files (PDF, ODT). So
I started to use Jackrabbit in my project. As i found out there is
In our project we use jackrabbit with spring and tomcat to manage pdf files.
is there a tool that can list third party packages that contain (third party)
I'm looking for a way to provide upload/download mechanism for blob files. These files
When running Apache Jackrabbit JCR as an embedded service in your app, is there
I am using Jackrabbit with JCR, how can I change the order of the
How do I browse a jackrabbit repository using a spring-mvc webapp? How do I
my goal is to store information about projects within Jackrabbit. Each project can consist

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.