ide/src/wombat/gui/actions/Upload.java
public void actionPerformed(ActionEvent event) {
		File file = DocumentManager.getActiveFile();
		
		// Get the URL to fetch.
		String url = null;
		if (file == null) {
			url = BASE_URL;
		} else {
			String name = file.getName();
			int pos = name.lastIndexOf(".");
			if (pos != -1) name = name.substring(0, pos);
			
			try {
				url = FILE_URL.replace("{assignment_name}", URLEncoder.encode(name, "UTF-8"));
			} catch (IOException e) {
				url = BASE_URL;
			}
		}
		
		// Try to open it in the user's browser.
		try {
			Desktop.getDesktop().browse(URI.create(url));
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
/**
	 * Open the correct submission page in the user's web browser.
	 * @param event Event parameters (ignored).
	 * @see URLEncoder, Desktop,DocumentManager
	 */
Open the correct submission page in the user's web browser.
@param event Event parameters (ignored).
Open the correct submission page in the user ' s web browser . @param event Event parameters ( ignored ) .
public void actionPerformed(ActionEvent event) {
		File file = DocumentManager.getActiveFile();
		String url = null;
		if (file == null) {
			url = BASE_URL;
		} else {
			String name = file.getName();
			int pos = name.lastIndexOf(".");
			if (pos != -1) name = name.substring(0, pos);
			try {
				url = FILE_URL.replace("{assignment_name}", URLEncoder.encode(name, "UTF-8"));
			} catch (IOException e) {
				url = BASE_URL;
			}
		}
		try {
			Desktop.getDesktop().browse(URI.create(url));
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
public void actionPerformed ( ActionEvent event ) { File file = DocumentManager . getActiveFile ( ) ; String url = null ; if ( file == null ) { url = BASE_URL ; } else { String name = file . getName ( ) ; int pos = name . lastIndexOf ( "." ) ; if ( pos != - 1 ) name = name . substring ( 0 , pos ) ; try { url = FILE_URL . replace ( "{assignment_name}" , URLEncoder . encode ( name , "UTF-8" ) ) ; } catch ( IOException e ) { url = BASE_URL ; } } try { Desktop . getDesktop ( ) . browse ( URI . create ( url ) ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } }
Open the correct submission page in the user's web browser.
Open the correct submission page in the user ' s web browser .
// Get the URL to fetch. // Try to open it in the user's browser.