Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jgit-dev] Monitor progress of UploadPack

Hi List,

First of all: Thanks for developing JGit! It's a terrific project.

I'm new to the JGit Codebase but I studied the source a bit before
asking this question.

I'm using the UploadPack class with custom IO streams in a Server
application. I basically simulate a simple SSH shell using Apache Mina.

I run all commands in a seperate Thread and want my thread to wait for
UploadPack#upload() to complete. Before continuing execution. Is there
some kind of monitor available? My code looks something like that:

    @Override
    public void service() throws Exception {
        Thread uploadThread = new Thread(new Runnable() {
            @Override
            public void run() {
                try {
                    UploadPack up = new UploadPack(new Repository(new
File("C:/tem/jgit/.git")));
                    up.upload(getInputStream(), getOutputStream(),
getErrorStream());
                } catch (IOException ioe) {
                    throw new RuntimeException("UploadPack produced an
IO Exception",ioe);
                }
            }
        });
        uploadThread.start();
    }

But it seems that UploadPack kicks of some background IO and I need to
wait for that to finish.

Thanks so much,
Sebastian


Back to the top