OT: Good version control/synchronization program for my Java apps

Hi,
I use one of my Java apps on a number of computers in my home, as well as on my work computer. The program is over a meg, but I make changes to it (almost daily) that affect only a few small files. I'd like to find a (preferably free) program that can do something like the following:
I make a change, then click "update on server." The program sends any modified files (and only modified files) to my web server (whose ftp or ssh information i will have configured in the program).
Now, when I am on any of computers (which would also have the program I'm looking for installed), I just click "sync to latest version" and it downloads the new files from my server.
I know Tortoise SVN is supposed to be good for version control, but I can't tell if it can do something like I described above.
Thanks in advance for any ideas,
John

Both Subversion and CVS provide this kind of support. They both have Windows clients that integrate with the Windows file system. For Subversion the commonly used Windows client is Tortoise, for CVS its WinCVS, there are others.
Subversion is newer and easier to use, but is not supported by as many IDE's as CVS. Eg. JSE8 doesn't support SVN directly, although there is a profile you can install.

Similar Messages

  • Is there a version of PROMOB program for MAC?

    is there a version of PROMOB program for MAC? if not, can I run the windows version, and what do I have to do?

    Windows on Intel Macs
    There are presently several alternatives for running Windows on Intel Macs.
         1. Install the Apple Boot Camp software.  Purchase Windows
             XP w/Service Pak2, Vista, or Windows 7.  For Boot Camp
             4.0 and above you can only use Windows 7 or later. Follow
             instructions in the Boot Camp documentation on
             installation of Boot Camp, creating Driver CD, and
             installing Windows.  Boot Camp enables you to boot the
             computer into OS X or Windows.
         2. Parallels Desktop for Mac and Windows XP, Vista Business,
             Vista Ultimate, or Windows 7.  Parallels is software
             virtualization that enables running Windows concurrently
             with OS X.
         3. VM Fusion and Windows XP, Vista Business, Vista Ultimate,
             or Windows 7.  VM Fusion is software virtualization that
             enables running Windows concurrently with OS X.
         4. CrossOver which enables running many Windows
             applications without having to install Windows.  The
             Windows applications can run concurrently with OS X.
         5. VirtualBox is an Open Source freeware virtual machine such
             as VM Fusion and Parallels that was developed by Solaris.
             It is not as fully developed for the Mac as Parallels and VM
             Fusion.
    Note that VirtualBox, Parallels, and VM Fusion can also run other operating systems such as Linux, Unix, OS/2, Solaris, etc.  There are performance differences between dual-boot systems and virtualization.  The latter tend to be a little slower (not much) and do not provide the video performance of the dual-boot system. See MacTech Labs- Virtualization Benchmarks, January 2013 | MacTech for comparisons of Boot Camp, Parallels, and VM Fusion. Boot Camp is only available with Leopard or Snow Leopard. Except for Crossover and a couple of similar alternatives like DarWine you must have a valid installer disc for Windows.
    You must also have an internal optical drive for installing Windows. Windows cannot be installed from an external optical drive.

  • Can anyone recommend a good Mac Calendar, Contact program for the iPhone

    Can anyone recommend a good Mac Calendar, Contact program for the iPhone. The one intalled is hopelessly inadequate and inefficient. 2 Main problems- The current iCal + Contacts programs do not link to each other. And there is no To Do List!
    Palm and MS Outlook had those features 6 years ago! Whats up with Apple?!!

    ical does have a to do list in it. either click the little pin under the calendar, or click show to do list in the view menu.
    i don't know much purpose behind needing to link ical and address book (not that i'm saying it isn't important at all - you obviously have some type of need for it). but it's got to be possible somehow, because you can set ical to make a calendar of birthdays from your address book contacts (in the main preference pane for the application).
    plus, i doubt there'd be another mac calendar application you'd be able to sync with your iphone, unless whoever developed it developed an iphone app to sync it with. probably wouldn't sync with your contacts/calendar apps that come with the iphone.

  • Synchronisation and concurrent programming for embedded Java

    Hi,
    I am looking for Informations about Synchronisation of concurrent access to Objekts for embedded Java applications. Are there Design Patterns or for this topic or general for Sync. in embedded Systems? And are there Embedded JVMs, with special Synchronisation for Embedded Java Apps? I am also looking for an Overview of existing Embedded JVMs of the market. Who can help with e.g. Infos, Books, Links and so on?
    Thanks

    [takeshi_fl],
    It is better for you to post this question under the topic "Embedded Java" on this forum website.

  • Can ABAP program and a Java apps access the same DB table?

    If an ABAP program and a Java apps access the same DB table, how does the Enqueue services from ABAP and Java communicate with each other to ensure locking consistency (if they even communicate with each otehr at all)?
    Or there wont be such situation because there are separate schema for ABAP stack and Java stack?
    Your help is greatly appreciated.

    Hello!
    A while ago I was a subject to criticism too for not granting points to helpfull answers. I appeared to be ungratefull, but I'm actually not (I guess the same goes for Vincent). I absolutely agree that good people who provide helpfull answers deserve (at least) points, but I didn't quite get the whole idea with points untill I was explicitly warned. I took some time to correct this and I granted points for all my past questions, generously, with "interest rates" for waiting.
    My point is:
    The pointing system is good, but unintuitive and not documented. I suggested this at that time, and I see that nothing has changed since. I see also that I'm not the only one who has experienced missunderstandings.
    I repeat the message to SDN people: Please provide some info on pointing system! A few sentences behind a "What's this?" link would do. It's not such a hard work.
    Thanks!
    Kind regards,
    Igor Barbaric

  • Pre verify tool for wireless Java apps - HPUX

    Hi wireless gurus,
    1. Does Oracle ships a pre verify tool for wireless Java apps for HPUX platform with any of it's products.
    2. Please let me know any such tool for HPUX, preferably with a free demo version

    Hi wireless gurus,
    1. Does Oracle ships a pre verify tool for wireless Java apps for HPUX platform with any of it's products.What kind of pre-verify tools are you referring to?
    If you are looking something to verify Java code in general, then Jdeveloper has some features built-in for this purpose.
    The Oracle9IAS Wireless service designer allows you test, try, and debug wireless apps.
    2. Please let me know any such tool for HPUX, preferably with a free demo version

  • Looking for good real time STOCK program for my Mac (free)

    Hi there!
    I wanted to throw this question to you guys out there. Does anyone know of any good, may be free, program to keep track of stock quotes in real time. Something with a real time running line with quotes. It would be nice to have something just sitting as a background on my desktop or as a wedget or in the dock, something that can do real time though.
    Please advice.
    Thanks

    Yuri:
    Yahoo Finance will give you real time quotes on specific stocks, say, in a portfolio. Many brokerage firm websites like Ameritrade offer Real Time quotes, too, but require that you have an account. Some other sites, and I don't remember exactly, offer a ticker tape type display; off the top of my head I'd say Intuit, CNN Money, MSNBC. Or you can try Market Browser.
    If I think of anything else I will post back.
    cornelius

  • Good/robust/high performance solution for calling Java from C

    Hi,
    I am looking for a good/robust/high performance solution for invoking a local java component from a C application in Windows.
    About Java component:
    - It has multiple methods that would be called very frequently from C application
    - It will reside in local machine. This machine may not have access to internet/LAN.
    My preference is to implement this java component as indepent running exe and have C application make outprocess calls. Is this possible?
    Any help/suggestions on this are greatly appreciated
    Thanks,
    -Arun

    I will stop replying to this conversation, unless it
    remains professional and without getting personal.I suggest you read your replies again then since you were the one that strayed from the topic and referred to my competency.
    >
    Or conversely those that have been working with JNIfor close to 10 years >might have a different opinion
    that someone who is promoting a commercial >product?
    I cannot see anything wrong with sharing and letting
    people know of potential solutions that might help to
    solve their problems.Not a problem at all.
    You however stated an absolute. I asked you to back up that absolute with something that was objective.
    You then lashed out at me and questioned my competency.
    >
    So you are questioning my competence as well as myintent?
    And not bothering to address the question at all.
    I am guessing you haven't actually attempted tocompare JNI to on board >sockets but instead you are
    just guessing.
    Frankly, I don't see how a socket solution with
    process switching overhead is going to work faster
    than a direct method call, passing parameters over
    the stack, the whole operation taking place
    in-process.
    And thus, as I thought, you haven't actually attempted to compare the two.
    And in terms of competency I can only wonder if youare competent enough
    to write the test frameworks that would demonstrateone or the other.
    As said earlier, there is no need to get personal,
    let's keep professional!
    And as I said earlier I would suggest that you look to your own replies.
    As mentioned, I do have enough experience for those
    who need to interoperate with Java using JNI, and can
    show how to do it in a safe and productive manner.
    And as I have said for the third time now that has nothing to do with what I actually asked you.
    The code that someone writes via JNI has much lessusage, and thus is much >more likely to have
    problems. Even if someone is competent in creating
    JNI >and C code.
    Thus JNI Is less stable.
    And by the way that includes the commercial productthat you are promoting >as well.
    Expressing an opinion on a product just based on its
    underlying technology without proper evaluation
    doesn't sound like constructive criticism.
    So you are claiming that your product is in fact more stable than the VM or at least as stable even though it has had far, far less usage?
    The only thing that can be said about the product so
    far, it that a product that is in production for some
    years without any problems, has a certain level of
    reliability and quality, whatever the underlying
    technology might be, and that there is enough
    competency with JNI to produce it and advice about
    the technology.
    True. But you were the one that brought up unrelated issues and then, as best as I can tell, thought to challenge my knowledge by pointing out how VMs "really" work.

  • How to create a set up program for my Java application

    Can some one please tell how to create a Setup for my Java Application

    Thanks for your reply.
    But still if you could have answered my query it would have been of a little more help for me, as I am quite new to any of these kinds of forum.
    Still thanks a lot for the reply.

  • Book for selling Java app

    Hows it going?
    I have made a java program that I want to sell via a website which I need to set up and I would like to buy a book which can guide me through this (I have 7 years Java programming experience but no real experience of deployment or websites).
    I need to know:
    * How to allow a user to download a 30 trial version which will then expire unless they buy the app.
    * How to accept payment for the app
    * How to prevent others from just reselling my app themselves (copyright?)
    * How to put a forum on the site
    What I am after is a book that will cover as many of these requirements as possible.
    Can anyone recommend anything?
    Thanks a lot,
    Jim

    Its an application for people learning foreign languages. It doesnt use any database and is a stand alone pure java app. It does write to the users local File system to store the data for the app.

  • PKGBUILD Tips for Funky Java App

    I'm trying to make a PKGBUILD for the GURPS character sheet program. It's a Java app, so I tried to follow the Java PKGBUILD guidelines from the wiki, but gcs has a weird build system that made things difficult. The main annoyances are that it tries to include its own JRE, and rather than running using a normal jar it includes a binary launcher for which I can't find the source.
    Here's my PKGBUILD that just tries to whip the binary package into shape:
    pkgname=gcs
    pkgver=4.0.1
    pkgrel=1
    pkgdesc="An editor for building character sheets for GURPS 4th Edition."
    arch=('i686' 'x86_64')
    url="http://gurpscharactersheet.com"
    license=('MPL')
    depends=('java-runtime')
    src="$pkgname-$pkgver-linux"
    if test "$CARCH" == i686; then
    src+='-32'
    fi
    source=("${src}.zip::http://sourceforge.net/projects/gcs-java/files/${src}.zip/download")
    md5sums=('SKIP')
    build() {
    pushd $srcdir/$src
    rm -r support/jre
    ln -s /usr/lib/jvm/default/jre support/jre
    popd
    package() {
    install -d $pkgdir/usr/{bin,share}
    cp -dr --no-preserve=ownership ${src} $pkgdir/usr/share/gcs
    ln -s $pkgdir/usr/share/gcs/gcs $pkgdir/usr/bin/gcs
    Am I doing anything stupid?

    How are you supposed to configure a package that requires Java 8? Should I not use $JAVA_HOME since that could be pointing to an older version?
    Anyway, I've produced a better package, but the build process is still kinda ugly.
    I couldn't figure out a way to use ant's bundle (which includes the JRE and the precompiled binaries), so I skipped that entirely and just copied everything myself - that let me use the recommended /usr/share/java organization. But since the app expects everything to be in one directory (with a fixed path), I had to patch it to let me configure the app directory using an environment variable.
    Here's a git repo for the files: https://github.com/silverhammermba/gcs
    And my new PKGBUILD:
    pkgname=gcs
    pkgver=4.0.1
    pkgrel=1
    pkgdesc="A WYSIWYG editor for building character sheets for GURPS 4th Edition."
    arch=('any')
    url="http://gurpscharactersheet.com"
    license=('MPL')
    makedepends=('git' 'apache-ant')
    depends=('java-runtime')
    source=(
    'git://code.trollworks.com/apple_stubs.git'
    "git://code.trollworks.com/gcs.git#tag=$pkgver"
    "git://code.trollworks.com/toolkit.git#tag=$pkgver"
    md5sums=('SKIP' 'SKIP' 'SKIP')
    prepare() {
    cd "$srcdir/toolkit"
    git apply "$startdir/set_app_path_from_env.patch"
    build() {
    cd "$srcdir/apple_stubs"
    ant
    cd "$srcdir/toolkit"
    ant
    cd "$srcdir/gcs"
    ant
    package() {
    install -d "$pkgdir/usr/share/java/gcs"
    find "$srcdir" -name '*.jar' ! -name '*-src.*' -execdir install -m644 {} "$pkgdir/usr/share/java/gcs" \;
    mv $pkgdir/usr/share/java/gcs/gcs-*.jar "$pkgdir/usr/share/java/gcs/gcs.jar"
    install -d "$pkgdir/usr/share/gcs"
    cp -dr --no-preserve=ownership "$srcdir/gcs/Library" "$pkgdir/usr/share/gcs"
    install -Dm755 "$startdir/gcs.sh" "$pkgdir/usr/bin/gcs"
    Last edited by silverhammermba (2014-10-01 15:23:13)

  • How do I set proxy settings for a Java app behind a corporate server?

    I have the source code of a Download Manager program written in Java. It has to be run within my college network in which we use the "Corporate Client" server to access the internet. The HTTP proxy is 172.16.68.6 and Port number is 3128. How do I define these parameters in my java program so that it can download files from the internet?
    The source code for the program is:
    There are four classes:
    1. DownloadManager.java
    2. Download.java
    3. DownloadTable.java
    4. ProgressRenderer.java
    /*__DownloadManager.java__*/
    import java.awt.*;
    import java.awt.event.*;
    import java.net.*;
    import java.util.*;
    import javax.swing.*;
    import javax.swing.event.*;
    // The Download Manager.
    public class DownloadManager extends JFrame
            implements Observer {
        // Add download text field.
        private JTextField addTextField;
        // Download table's data model.
        private DownloadsTableModel tableModel;
        // Table listing downloads.
        private JTable table;
        // These are the buttons for managing the selected download.
        private JButton pauseButton, resumeButton;
        private JButton cancelButton, clearButton;
        // Currently selected download.
        private Download selectedDownload;
        // Flag for whether or not table selection is being cleared.
        private boolean clearing;
        // Constructor for Download Manager.
        public DownloadManager() {
            // Set application title.
            setTitle("Download Manager");
            // Set window size.
            setSize(640, 480);
            // Handle window closing events.
            addWindowListener(new WindowAdapter() {
                public void windowClosing(WindowEvent e) {
                    actionExit();
            // Set up file menu.
            JMenuBar menuBar = new JMenuBar();
            JMenu fileMenu = new JMenu("File");
            fileMenu.setMnemonic(KeyEvent.VK_F);
            JMenuItem fileExitMenuItem = new JMenuItem("Exit",
                    KeyEvent.VK_X);
            fileExitMenuItem.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    actionExit();
            fileMenu.add(fileExitMenuItem);
            menuBar.add(fileMenu);
            setJMenuBar(menuBar);
            // Set up add panel.
            JPanel addPanel = new JPanel();
            addTextField = new JTextField(30);
            addPanel.add(addTextField);
            JButton addButton = new JButton("Add Download");
            addButton.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    actionAdd();
            addPanel.add(addButton);
            // Set up Downloads table.
            tableModel = new DownloadsTableModel();
            table = new JTable(tableModel);
            table.getSelectionModel().addListSelectionListener(new
                    ListSelectionListener() {
                public void valueChanged(ListSelectionEvent e) {
                    tableSelectionChanged();
            // Allow only one row at a time to be selected.
            table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
            // Set up ProgressBar as renderer for progress column.
            ProgressRenderer renderer = new ProgressRenderer(0, 100);
            renderer.setStringPainted(true); // show progress text
            table.setDefaultRenderer(JProgressBar.class, renderer);
            // Set table's row height large enough to fit JProgressBar.
            table.setRowHeight(
                    (int) renderer.getPreferredSize().getHeight());
            // Set up downloads panel.
            JPanel downloadsPanel = new JPanel();
            downloadsPanel.setBorder(
                    BorderFactory.createTitledBorder("Downloads"));
            downloadsPanel.setLayout(new BorderLayout());
            downloadsPanel.add(new JScrollPane(table),
                    BorderLayout.CENTER);
            // Set up buttons panel.
            JPanel buttonsPanel = new JPanel();
            pauseButton = new JButton("Pause");
            pauseButton.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    actionPause();
            pauseButton.setEnabled(false);
            buttonsPanel.add(pauseButton);
            resumeButton = new JButton("Resume");
            resumeButton.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    actionResume();
            resumeButton.setEnabled(false);
            buttonsPanel.add(resumeButton);
            cancelButton = new JButton("Cancel");
            cancelButton.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    actionCancel();
            cancelButton.setEnabled(false);
            buttonsPanel.add(cancelButton);
            clearButton = new JButton("Clear");
            clearButton.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    actionClear();
            clearButton.setEnabled(false);
            buttonsPanel.add(clearButton);
            // Add panels to display.
            getContentPane().setLayout(new BorderLayout());
            getContentPane().add(addPanel, BorderLayout.NORTH);
            getContentPane().add(downloadsPanel, BorderLayout.CENTER);
            getContentPane().add(buttonsPanel, BorderLayout.SOUTH);
        // Exit this program.
        private void actionExit() {
            System.exit(0);
        // Add a new download.
        private void actionAdd() {
            URL verifiedUrl = verifyUrl(addTextField.getText());
            if (verifiedUrl != null) {
                tableModel.addDownload(new Download(verifiedUrl));
                addTextField.setText(""); // reset add text field
            } else {
                JOptionPane.showMessageDialog(this,
                        "Invalid Download URL", "Error",
                        JOptionPane.ERROR_MESSAGE);
        // Verify download URL.
        private URL verifyUrl(String url) {
            // Only allow HTTP URLs.
            if (!url.toLowerCase().startsWith("http://"))
                return null;
            // Verify format of URL.
            URL verifiedUrl = null;
            try {
                verifiedUrl = new URL(url);
            } catch (Exception e) {
                return null;
            // Make sure URL specifies a file.
            if (verifiedUrl.getFile().length() < 2)
                return null;
            return verifiedUrl;
        // Called when table row selection changes.
        private void tableSelectionChanged() {
        /* Unregister from receiving notifications
           from the last selected download. */
            if (selectedDownload != null)
                selectedDownload.deleteObserver(DownloadManager.this);
        /* If not in the middle of clearing a download,
           set the selected download and register to
           receive notifications from it. */
            if (!clearing) {
                selectedDownload =
                        tableModel.getDownload(table.getSelectedRow());
                selectedDownload.addObserver(DownloadManager.this);
                updateButtons();
        // Pause the selected download.
        private void actionPause() {
            selectedDownload.pause();
            updateButtons();
        // Resume the selected download.
        private void actionResume() {
            selectedDownload.resume();
            updateButtons();
        // Cancel the selected download.
        private void actionCancel() {
            selectedDownload.cancel();
            updateButtons();
        // Clear the selected download.
        private void actionClear() {
            clearing = true;
            tableModel.clearDownload(table.getSelectedRow());
            clearing = false;
            selectedDownload = null;
            updateButtons();
      /* Update each button's state based off of the
         currently selected download's status. */
        private void updateButtons() {
            if (selectedDownload != null) {
                int status = selectedDownload.getStatus();
                switch (status) {
                    case Download.DOWNLOADING:
                        pauseButton.setEnabled(true);
                        resumeButton.setEnabled(false);
                        cancelButton.setEnabled(true);
                        clearButton.setEnabled(false);
                        break;
                    case Download.PAUSED:
                        pauseButton.setEnabled(false);
                        resumeButton.setEnabled(true);
                        cancelButton.setEnabled(true);
                        clearButton.setEnabled(false);
                        break;
                    case Download.ERROR:
                        pauseButton.setEnabled(false);
                        resumeButton.setEnabled(true);
                        cancelButton.setEnabled(false);
                        clearButton.setEnabled(true);
                        break;
                    default: // COMPLETE or CANCELLED
                        pauseButton.setEnabled(false);
                        resumeButton.setEnabled(false);
                        cancelButton.setEnabled(false);
                        clearButton.setEnabled(true);
            } else {
                // No download is selected in table.
                pauseButton.setEnabled(false);
                resumeButton.setEnabled(false);
                cancelButton.setEnabled(false);
                clearButton.setEnabled(false);
      /* Update is called when a Download notifies its
         observers of any changes. */
        public void update(Observable o, Object arg) {
            // Update buttons if the selected download has changed.
            if (selectedDownload != null && selectedDownload.equals(o))
                updateButtons();
        // Run the Download Manager.
        public static void main(String[] args) {
            DownloadManager manager = new DownloadManager();
            manager.show();
    This example shows how to create a simple download manager in Java. It contains four classes in foru Java source files:
    Download.java: Contains Download class which downloads a file from a URL.
    DownloadManager.java: Contains the main class for download manager application.
    DownloadsTableModel.java: Contains the class which manages the download table's data.
    ProgressRenderer.java: Contains the class which is responsible to render a JProgressBar in a table cell.
    The contents of the listed files are written below.
    /*__Download.java__*/
    import java.io.*;
    import java.net.*;
    import java.util.*;
    // This class downloads a file from a URL.
    class Download extends Observable implements Runnable {
        // Max size of download buffer.
        private static final int MAX_BUFFER_SIZE = 1024;
        // These are the status names.
        public static final String STATUSES[] = {"Downloading",
        "Paused", "Complete", "Cancelled", "Error"};
        // These are the status codes.
        public static final int DOWNLOADING = 0;
        public static final int PAUSED = 1;
        public static final int COMPLETE = 2;
        public static final int CANCELLED = 3;
        public static final int ERROR = 4;
        private URL url; // download URL
        private int size; // size of download in bytes
        private int downloaded; // number of bytes downloaded
        private int status; // current status of download
        // Constructor for Download.
        public Download(URL url) {
            this.url = url;
            size = -1;
            downloaded = 0;
            status = DOWNLOADING;
            // Begin the download.
            download();
        // Get this download's URL.
        public String getUrl() {
            return url.toString();
        // Get this download's size.
        public int getSize() {
            return size;
        // Get this download's progress.
        public float getProgress() {
            return ((float) downloaded / size) * 100;
        // Get this download's status.
        public int getStatus() {
            return status;
        // Pause this download.
        public void pause() {
            status = PAUSED;
            stateChanged();
        // Resume this download.
        public void resume() {
            status = DOWNLOADING;
            stateChanged();
            download();
        // Cancel this download.
        public void cancel() {
            status = CANCELLED;
            stateChanged();
        // Mark this download as having an error.
        private void error() {
            status = ERROR;
            stateChanged();
        // Start or resume downloading.
        private void download() {
            Thread thread = new Thread(this);
            thread.start();
        // Get file name portion of URL.
        private String getFileName(URL url) {
            String fileName = url.getFile();
            return fileName.substring(fileName.lastIndexOf('/') + 1);
        // Download file.
        public void run() {
            RandomAccessFile file = null;
            InputStream stream = null;
            try {
                // Open connection to URL.
                HttpURLConnection connection =
                        (HttpURLConnection) url.openConnection();
                // Specify what portion of file to download.
                connection.setRequestProperty("Range",
                        "bytes=" + downloaded + "-");
                // Connect to server.
                connection.connect();
                // Make sure response code is in the 200 range.
                if (connection.getResponseCode() / 100 != 2) {
                    error();
                // Check for valid content length.
                int contentLength = connection.getContentLength();
                if (contentLength < 1) {
                    error();
          /* Set the size for this download if it
             hasn't been already set. */
                if (size == -1) {
                    size = contentLength;
                    stateChanged();
                // Open file and seek to the end of it.
                file = new RandomAccessFile(getFileName(url), "rw");
                file.seek(downloaded);
                stream = connection.getInputStream();
                while (status == DOWNLOADING) {
            /* Size buffer according to how much of the
               file is left to download. */
                    byte buffer[];
                    if (size - downloaded > MAX_BUFFER_SIZE) {
                        buffer = new byte[MAX_BUFFER_SIZE];
                    } else {
                        buffer = new byte[size - downloaded];
                    // Read from server into buffer.
                    int read = stream.read(buffer);
                    if (read == -1)
                        break;
                    // Write buffer to file.
                    file.write(buffer, 0, read);
                    downloaded += read;
                    stateChanged();
          /* Change status to complete if this point was
             reached because downloading has finished. */
                if (status == DOWNLOADING) {
                    status = COMPLETE;
                    stateChanged();
            } catch (Exception e) {
                error();
            } finally {
                // Close file.
                if (file != null) {
                    try {
                        file.close();
                    } catch (Exception e) {}
                // Close connection to server.
                if (stream != null) {
                    try {
                        stream.close();
                    } catch (Exception e) {}
        // Notify observers that this download's status has changed.
        private void stateChanged() {
            setChanged();
            notifyObservers();
    /*__DownloadTableModel.java__*/
    import java.util.*;
    import javax.swing.*;
    import javax.swing.table.*;
    // This class manages the download table's data.
    class DownloadsTableModel extends AbstractTableModel
            implements Observer {
        // These are the names for the table's columns.
        private static final String[] columnNames = {"URL", "Size",
        "Progress", "Status"};
        // These are the classes for each column's values.
        private static final Class[] columnClasses = {String.class,
        String.class, JProgressBar.class, String.class};
        // The table's list of downloads.
        private ArrayList downloadList = new ArrayList();
        // Add a new download to the table.
        public void addDownload(Download download) {
            // Register to be notified when the download changes.
            download.addObserver(this);
            downloadList.add(download);
            // Fire table row insertion notification to table.
            fireTableRowsInserted(getRowCount() - 1, getRowCount() - 1);
        // Get a download for the specified row.
        public Download getDownload(int row) {
            return (Download) downloadList.get(row);
        // Remove a download from the list.
        public void clearDownload(int row) {
            downloadList.remove(row);
            // Fire table row deletion notification to table.
            fireTableRowsDeleted(row, row);
        // Get table's column count.
        public int getColumnCount() {
            return columnNames.length;
        // Get a column's name.
        public String getColumnName(int col) {
            return columnNames[col];
        // Get a column's class.
        public Class getColumnClass(int col) {
            return columnClasses[col];
        // Get table's row count.
        public int getRowCount() {
            return downloadList.size();
        // Get value for a specific row and column combination.
        public Object getValueAt(int row, int col) {
            Download download = (Download) downloadList.get(row);
            switch (col) {
                case 0: // URL
                    return download.getUrl();
                case 1: // Size
                    int size = download.getSize();
                    return (size == -1) ? "" : Integer.toString(size);
                case 2: // Progress
                    return new Float(download.getProgress());
                case 3: // Status
                    return Download.STATUSES[download.getStatus()];
            return "";
      /* Update is called when a Download notifies its
         observers of any changes */
        public void update(Observable o, Object arg) {
            int index = downloadList.indexOf(o);
            // Fire table row update notification to table.
            fireTableRowsUpdated(index, index);
    /*__ProgressRenderer.java__*/
    import java.awt.*;
    import javax.swing.*;
    import javax.swing.table.*;
    // This class renders a JProgressBar in a table cell.
    class ProgressRenderer extends JProgressBar
            implements TableCellRenderer {
        // Constructor for ProgressRenderer.
        public ProgressRenderer(int min, int max) {
            super(min, max);
      /* Returns this JProgressBar as the renderer
         for the given table cell. */
        public Component getTableCellRendererComponent(
                JTable table, Object value, boolean isSelected,
                boolean hasFocus, int row, int column) {
            // Set JProgressBar's percent complete value.
            setValue((int) ((Float) value).floatValue());
            return this;
    }

    Thank you for the quick reply! But the solution provided by you, it seems, has still not been able to address my issue. I ran the program at command prompt with your said parameters, but the download still gave an error in the App window.
    Also, is there some way of defining these parameters in the source code? I am keen in using NetBeans to run the program.
    Cheers!

  • Simple Web Frontend for existing Java app

    Hi there!
    (sorry for my english at first ;)
    I have an existing java app which currently is used via command line. It's a server application which mostly does monitoring outputs and functions you can use in the shell are like starting/stopping the server. For these outputs and for starting/stopping and so on i want to create a simple web frontend which gives me the ability to do this.
    What do i need? It would be fine if i do not have to set up a large tomcat server because the program should run out of the box. Of course i want to access the website via the internet (simple login). The whole thing would be about 2-5 simple pages. Best thing would be if i could update the monitoring variables via java script.
    Can i use servlets (not much experience with it so far, that's why i ask :) )? What do i need for the webserver? Can i access my data variables from right from the servlet?
    Thanks in advance,
    kiwaque

    If you are familiar with Swing, I would suggest GWT for the Frontend... you can build and debug the Frontend similar to a Swing App, and then compile it to HTML/CSS/Javascript...

  • Is there a really good personal Financial software program for the iMac?

    Looking for a very good Personal Finance software for the iMac?

    I use iBank 5 and I've been quite happy with it. My needs are fairly modest, though, when it comes to that. All I really wanted was something to sync transactions between my Mac and iPhone to track checking accounts for day to day purchases.
    I manage my portfolio separately the "old fashioned" way.
    I don't know how it compares to the Windows version of Quicken, but there is a Mac version of Quicken (Quicken 2015) available in the app store.

  • How to start a shell script for a java app

    Hi all,
    I have a java application and have got a shell script to start it.
    How can I start this app just from the finder?
    Thanks
    Confidemus

    Fernardo,
    the following links should help you:
    - Technical Note TN2065
    - Applescript and Unix commands
    Mihalis.

Maybe you are looking for