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 6347229
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T21:10:26+00:00 2026-05-24T21:10:26+00:00

I am trying to access SVN through the process command in Java as part

  • 0

I am trying to access SVN through the process command in Java as part of a larger GUI to see what files are on the SVN. After much research, I have significantly refined my methods, however I still cannot accomplish it. If I run the code in the GUI, it just hangs. To discover what that problem was, I simplified it and ran it as a console program. When I ran it there, it displayed a request for my GNOME keyring. My code enters the password but the console does not seem to accept it. My code follows:

    public class SvnJavaTest{
            public static void main(String[] args){
                try {
                    String[] commands = {"svn", "ls", "https://svnserver"};
                    Process beginProcess = Runtime.getRuntime().exec(commands, null, new File("/home/users/ckorb/Desktop"));
                    BufferedReader br = new BufferedReader(new InputStreamReader(beginProcess.getInputStream()));
                    BufferedWriter write = new BufferedWriter(new OutputStreamWriter(beginProcess.getOutputStream()));
                    write.write("password");
                    write.flush(); 
                    String line=br.readLine();
                    while (line != null){
                            System.out.println(line);
                            line =br.readLine();
                    }
                    br.close();
                    write.close();
                    beginProcess.waitFor();
                } catch (IOException e1) {
                    e1.printStackTrace();
                } catch (InterruptedException ie) {
                    ie.printStackTrace();
                }
           }
    }

I don’t get any errors running this and if I type in my password manually into the console and then run it, it works because it remembers my password. I have looked and found that there are some packages that would automatically enter my keyring on login but that isn’t really an option. Thank you very much.

  • 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-05-24T21:10:27+00:00Added an answer on May 24, 2026 at 9:10 pm

    The main problem with a solution like this is that you don’t really have control over stdin and stdout. A malicious person can wrap the svn command with a shell script that makes a copy of the stdin (thereby capturing all the passwords your program transmits). While shell’s flexibility makes it great in so many ways, it is the same flexibility that you are connecting to, and you’d better be comfortable with it (and it’s consequences).

    That is the real reason why it is better to use a Java API to use the client, there’s a much smaller chance of injecting code which captures sensitive data (and better error reporting).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm looping through a directory in Java, trying to read each of the files.
Trying to setup SVN to use HTTP, with the user/auth user access files. I
I'm trying to execute post build svn commit command in Jenkins. I have access
Im trying to access the Magento customer session in another part of my website.
I'm trying to access the command line and execute a command, and then return
Im trying to access ValidationMessage through jquery. I have <%: Html.TextBox(vcr_LinkAddress,null, new { maxlength
I'm trying to access a svn repo on an OS X (snow leopard) server.
Is it possible to access an svn log without having svn installed? I'm trying
I'm trying to automate some stuff in SVN, and part of that is copying
Im trying to access a web service from a remote computer. I managed to

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.