How do I get past 401 error on downloading and image from DAM | Community
Skip to main content
Level 6
October 16, 2015
Solved

How do I get past 401 error on downloading and image from DAM

  • October 16, 2015
  • 1 reply
  • 700 views

When executing

    javax.jcr.Session session = repository.login(new SimpleCredentials(
                    "admin", "admin".toCharArray()));
            

BufferedImage image =   ImageIO.read(new URL(imageurl));

 

Where imageurl is the localhost path to my dam jpg file

 

I get error 401. How, do I use my Session obbject to allow   ImageIO.read(new URL(imageurl)) to access the session?

 

regards

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Sham_HC

For the URL object you need to attach Authorization http://stackoverflow.com/questions/496651/connecting-to-remote-url-which-requires-authentication-using-java

OR from session get the node & then inputstream and pass to ImageIO

1 reply

Sham_HC
Sham_HCAccepted solution
Level 10
October 16, 2015

For the URL object you need to attach Authorization http://stackoverflow.com/questions/496651/connecting-to-remote-url-which-requires-authentication-using-java

OR from session get the node & then inputstream and pass to ImageIO