java: remove commented out code
Change-Id: I44e2043e5da23bc9421c03e550ef1d8b7ebaad36
This commit is contained in:
@@ -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
|
||||
{
|
||||
|
@@ -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 );
|
||||
|
@@ -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();
|
||||
}
|
||||
}
|
||||
|
@@ -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;
|
||||
|
@@ -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 ));
|
||||
|
@@ -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<NewsGroup> subscribed = new ArrayList<NewsGroup>();
|
||||
// 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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user