From 0c5f51ebbcb7e22baa913e2012e3dcfcc6cf7897 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Tue, 5 Aug 2014 09:54:58 +0200 Subject: java: remove commented out code Change-Id: I44e2043e5da23bc9421c03e550ef1d8b7ebaad36 --- .../examples/java/MemoryUsage/MemoryUsage.java | 1 - .../examples/java/Newsgroup/MimeConfiguration.java | 4 ---- .../examples/java/Newsgroup/OfficeAttachment.java | 21 --------------------- .../examples/java/Newsgroup/PostNewsgroup.java | 8 -------- scripting/examples/java/Newsgroup/Sender.java | 1 - .../java/Newsgroup/SubscribedNewsgroups.java | 20 -------------------- 6 files changed, 55 deletions(-) (limited to 'scripting/examples') diff --git a/scripting/examples/java/MemoryUsage/MemoryUsage.java b/scripting/examples/java/MemoryUsage/MemoryUsage.java index a19f2cc5eb22..4776f2323cc0 100644 --- a/scripting/examples/java/MemoryUsage/MemoryUsage.java +++ b/scripting/examples/java/MemoryUsage/MemoryUsage.java @@ -41,7 +41,6 @@ import com.sun.star.script.provider.XScriptContext; public class MemoryUsage { - // public void updateMemoryUsage(XScriptContext ctxt, ActionEvent evt) public void updateMemoryUsage(XScriptContext ctxt) throws Exception { diff --git a/scripting/examples/java/Newsgroup/MimeConfiguration.java b/scripting/examples/java/Newsgroup/MimeConfiguration.java index d2cce9396c52..03e6c1b03116 100644 --- a/scripting/examples/java/Newsgroup/MimeConfiguration.java +++ b/scripting/examples/java/Newsgroup/MimeConfiguration.java @@ -78,7 +78,6 @@ public class MimeConfiguration { if( ! new File( java.net.URLDecoder.decode( mailcapPath ) ).exists() ) { - //System.out.println( "URLDecoder: " + java.net.URLDecoder.decode( mailcapPath ) ); File mailcapFile = new File( mailcapPath ); FileWriter out = new FileWriter( mailcapFile ); String[] lines = getMailcapText(); @@ -90,7 +89,6 @@ public class MimeConfiguration } else { - //System.out.println( "URLDecoder: " + java.net.URLDecoder.decode( mailcapPath ) ); } @@ -140,7 +138,6 @@ public class MimeConfiguration { if( ! new File( java.net.URLDecoder.decode( mimetypesPath ) ).exists() ) { - //System.out.println( "URLDecoder: " + java.net.URLDecoder.decode( mimetypesPath ) ); File mimetypesFile = new File( mimetypesPath ); FileWriter out = new FileWriter( mimetypesFile ); String[] lines = getMimeTypesText(); @@ -152,7 +149,6 @@ public class MimeConfiguration } else { - //System.out.println( "URLDecoder: " + java.net.URLDecoder.decode( mimetypesPath ) ); } MimetypesFileTypeMap mimeTypes = new MimetypesFileTypeMap( mimetypesPath ); diff --git a/scripting/examples/java/Newsgroup/OfficeAttachment.java b/scripting/examples/java/Newsgroup/OfficeAttachment.java index 327c3bdf1e89..c6b6fc9befab 100644 --- a/scripting/examples/java/Newsgroup/OfficeAttachment.java +++ b/scripting/examples/java/Newsgroup/OfficeAttachment.java @@ -98,50 +98,38 @@ public class OfficeAttachment public boolean createTempDocs() { String filenameURL = "file:///" + templocationURL + "/" + attachmentName; - //String filenameSystem = templocationSystem + System.getProperty( "file.separator" ) + attachmentName; - //JOptionPane.showMessageDialog( null, "Filename URL " + filenameURL ); try { if( isHtmlDoc ) { - //JOptionPane.showMessageDialog( null, "Saving doc in HTML format" ); statusLine = "Saving doc in HTML format"; status.setStatus( 4, statusLine ); - //System.out.print( "Saving attachment as " + filename + ".html..." ); PropertyValue[] propertyvalue_html = new PropertyValue[2]; propertyvalue_html[0] = new PropertyValue(); propertyvalue_html[0].Name = new String("Overwrite"); propertyvalue_html[0].Value = new Boolean(true); propertyvalue_html[1] = new PropertyValue(); propertyvalue_html[1].Name = ("FilterName"); -// propertyvalue_html[1].Value = new String("scalc: HTML (StarCalc)"); propertyvalue_html[1].Value = new String("swriter: HTML (StarWriter)"); storedDoc.storeAsURL( filenameURL + ".html", propertyvalue_html); File homedir = new File( templocationSystem ); - //JOptionPane.showMessageDialog( null, "homedir (Java File): " + homedir.getPath() ); File homefiles[] = homedir.listFiles(); String file = ""; for(int i=0; i < homefiles.length; i++ ) { if( homefiles[i].getName().equals( attachmentName + ".html" ) ) { - //htmlFile = new File( homefiles[i].getAbsolutePath() ); - //JOptionPane.showMessageDialog( null, "Found HTML" ); file = homefiles[i].getAbsolutePath(); } } htmlFile = new File( file ); - //htmlFile = new File( filename + ".html" ); - //htmlFile = new File( storedDoc.getLocation() ); } if( isOfficeDoc ) { - //JOptionPane.showMessageDialog( null, "Saving doc in .sxw format" ); statusLine = "Saving doc in .sxw format"; status.setStatus( 4, statusLine ); - //System.out.print( "Saving attachment as " + filename + ".sxw..." ); PropertyValue[] propertyvalue_sxw = new PropertyValue[2]; propertyvalue_sxw[0] = new PropertyValue(); propertyvalue_sxw[0].Name = new String("Overwrite"); @@ -153,8 +141,6 @@ public class OfficeAttachment File homedir = new File( templocationSystem ); - //JOptionPane.showMessageDialog( null, "homedir (Java File): " + homedir.getPath() ); - File homefiles[] = homedir.listFiles(); String file = ""; for(int i=0; i < homefiles.length; i++ ) @@ -212,24 +198,17 @@ public class OfficeAttachment { if( isOfficeDoc && isHtmlDoc ) { - //System.out.println( "Removing: " + htmlFile.getPath() + " " + officeFile.getPath() ); - //System.out.println( "htmlfile " + htmlFile.exists() + " officeFile " + officeFile.exists() ); - //JOptionPane.showMessageDialog( null, "Removing: " + htmlFile.getPath() + " " + officeFile.getPath() ); - //JOptionPane.showMessageDialog( null, "htmlfile " + htmlFile.exists() + " officeFile " + officeFile.exists() ); htmlFile.delete(); officeFile.delete(); - //JOptionPane.showMessageDialog( null, "htmlfile " + htmlFile.exists() + " officeFile " + officeFile.exists() ); } else { if( isOfficeDoc ) { - //System.out.println( "Removing: " + officeFile.getPath() ); officeFile.delete(); } else { - //System.out.println( "Removing: " + htmlFile.getPath() ); htmlFile.delete(); } } diff --git a/scripting/examples/java/Newsgroup/PostNewsgroup.java b/scripting/examples/java/Newsgroup/PostNewsgroup.java index 697b52a66a62..5f069b44dd19 100644 --- a/scripting/examples/java/Newsgroup/PostNewsgroup.java +++ b/scripting/examples/java/Newsgroup/PostNewsgroup.java @@ -321,7 +321,6 @@ public class PostNewsgroup extends JFrame if( subscribedNewsgroups == null ) { - //System.out.println( "Couldn't find any subscibed newsgroups in .mozilla" ); JOptionPane.showMessageDialog( window, "No subscribed newsgroups found in mozilla/netscape profile \nPlease enter newsgroup and host name", "Newsgroups Information", JOptionPane.INFORMATION_MESSAGE ); } @@ -467,7 +466,6 @@ public class PostNewsgroup extends JFrame Sender sender = new Sender( statusWindow, officeAttach, replyto, subject, comment, host, group ); if( !sender.sendMail() ) { - //System.out.println( "Should end here (?)" ); statusWindow.enableCancelButton( true ); officeAttach.cleanUpOnError(); return false; @@ -478,7 +476,6 @@ public class PostNewsgroup extends JFrame } else { - //System.out.println( "Non valid data" ); return false; } return true; @@ -593,7 +590,6 @@ public class PostNewsgroup extends JFrame } if( newsgroupString.length() == 0 ) { - //System.out.println( "Please enter a newsgroup name" ); newsgroupComboBox.requestFocus(); JOptionPane.showMessageDialog( window, "Please enter a newsgroup name", "Input Error", JOptionPane.ERROR_MESSAGE ); return false; @@ -604,7 +600,6 @@ public class PostNewsgroup extends JFrame String hostString = hostTextField.getText(); if( hostString.length() == 0 ) { - //System.out.println( "Please enter a hostname" ); hostTextField.requestFocus(); JOptionPane.showMessageDialog( window, "Please enter a hostname", "Input Error", JOptionPane.ERROR_MESSAGE ); return false; @@ -618,10 +613,8 @@ public class PostNewsgroup extends JFrame int atPos = replyString.indexOf( "@" ); int dotPos = replyString.lastIndexOf( "." ); int length = replyString.length(); - //System.out.println( "length: " + length + "\n atPos: " + atPos + "\n dotPos: " + dotPos ); if( length == 0 || atPos == -1 || dotPos == -1 || atPos < 2 || dotPos < atPos || dotPos + 2 == length || atPos + 2 == dotPos || atPos != replyString.lastIndexOf( "@" ) || replyString.indexOf(" ") != -1 ) { - //System.out.println( "Please enter a valid reply to email address" ); replyTextField.requestFocus(); JOptionPane.showMessageDialog( window, "Please enter a valid reply to email address", "Input Error", JOptionPane.ERROR_MESSAGE ); return false; @@ -632,7 +625,6 @@ public class PostNewsgroup extends JFrame String subjectString = subjectTextField.getText(); if( subjectString.length() == 0 ) { - //System.out.println( "Please enter subject title" ); subjectTextField.requestFocus(); JOptionPane.showMessageDialog( window, "Please enter subject title", "Input Error", JOptionPane.ERROR_MESSAGE ); return false; diff --git a/scripting/examples/java/Newsgroup/Sender.java b/scripting/examples/java/Newsgroup/Sender.java index 0efe27ca9931..efa3ed4c6753 100644 --- a/scripting/examples/java/Newsgroup/Sender.java +++ b/scripting/examples/java/Newsgroup/Sender.java @@ -91,7 +91,6 @@ public class Sender File attachs[] = attachments.getAttachments(); for(int i=0; i < attachs.length; i++ ) { - //System.out.println( "Adding file: " + attachs[i].getName() ); messageBodyPart = new MimeBodyPart(); DataSource filesource = new FileDataSource( attachs[i] ); messageBodyPart.setDataHandler( new DataHandler( filesource )); diff --git a/scripting/examples/java/Newsgroup/SubscribedNewsgroups.java b/scripting/examples/java/Newsgroup/SubscribedNewsgroups.java index cba9d62f59dc..e73ea3310eca 100644 --- a/scripting/examples/java/Newsgroup/SubscribedNewsgroups.java +++ b/scripting/examples/java/Newsgroup/SubscribedNewsgroups.java @@ -63,35 +63,28 @@ public class SubscribedNewsgroups { if( windows ) { mozillaHome = System.getProperty( "user.home" ) + System.getProperty( "file.separator" ) + "Application Data" + System.getProperty( "file.separator" ) + "Mozilla" + System.getProperty( "file.separator" ) + "Profiles"; - //System.out.println( "Windows mozilla path: " + mozillaHome ); } else { mozillaHome = System.getProperty( "user.home" ) + System.getProperty( "file.separator" ) + ".mozilla"; - //System.out.println( "Unix/Linux mozilla path: " + mozillaHome ); } if( !new File( mozillaHome ).isDirectory() ) { - //System.out.println("Could not find .mozilla directory"); return null; } - //System.out.println(".mozilla directory found"); // Get all the profiles belonging to the user File profiles[] = findProfiles( new File ( mozillaHome ) ); if( profiles.length < 1 ) { - //System.out.println("Could not find Profiles"); return null; } - //System.out.println("Profiles found"); // Get the News directory for each profile File allNewsDirs[] = new File[ profiles.length ]; for( int i=0; i < profiles.length; i++ ) { File newsDir = findNewsDir( profiles[i] ); allNewsDirs[i] = newsDir; - //System.out.println( "News is at: " + newsDir.getPath() ); } // Check that at least one News directory exists and remove nulls boolean newsFound = false; @@ -104,19 +97,15 @@ public class SubscribedNewsgroups { } if( !newsFound ) { - //System.out.println("Could not find News directory"); return null; } - //System.out.println("News directory found"); // Get all the mailrc files for each News directory File allMailrcs[] = findMailrcFiles( allNewsDirs ); if( allMailrcs == null ) { - //System.out.println("Could not find mailrc files"); return null; } - //System.out.println("mailrc files found"); ArrayList subscribed = new ArrayList(); // Get the newsgroups in each mailrc file @@ -141,10 +130,8 @@ public class SubscribedNewsgroups { // Test that at least one subscribed newsgroup has been found if( allSubscribed.length < 1 ) { - //System.out.println("Could not find Subscribed newsgroups "); return null; } - //System.out.println("Subscribed newsgroups found"); return allSubscribed; } @@ -236,16 +223,13 @@ public class SubscribedNewsgroups { for( int i=0; i < newsDirs.length; i++ ) { - //System.out.println( "Finding mailrc for: " + newsDirs[i] ); if( newsDirs[i] != null ) { File mailrcFiles[] = newsDirs[i].listFiles( new VersionFilter() ); if( mailrcFiles != null ) { - //System.out.println( "Number found: " + mailrcFiles.length ); for( int j=0; j < mailrcFiles.length; j++ ) { - //System.out.println( "This mailrc was found: " + mailrcFiles[j] ); allFiles.addElement( mailrcFiles[j] ); } } @@ -254,14 +238,10 @@ public class SubscribedNewsgroups { File allMailrcFiles[] = new File[ allFiles.size() ]; allFiles.copyInto(allMailrcFiles); - //System.out.println( "number of mailrcs in total: " + allMailrcFiles.length ); - if( allMailrcFiles.length == 0 ) { - //System.out.println( "Returning null"); return null; } - //System.out.println( "Returning an File array containing mailrcs"); return allMailrcFiles; } -- cgit v1.2.3