Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: Send Scanned File to E-mail

  1. #1
    Junior Member
    Join Date
    Apr 2011
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Send Scanned File to E-mail

    I have a program that searches a file and the program says that my import (FileUtils) is not existing in the packages.. does this mean i need to download a seperate package for this?

    here is the code
    import org.apache.commons.io.FileUtils;
    import java.io.File;
    import java.util.Collection;
    import java.util.Iterator;
     
    public class SearchFile{
    	public static void main(String[] args) {
    		File root = new File("D:\Program Files");
     
    	try {
    		String[] extensions = {"txt"};
    			boolean recursive = true;
     
    	Collection files = FileUtils.listFiles(root, extensions, recursive);
     
    	for (Iterator iterator = files.iterator(); iterator.hasNext();) {
    		File pfile = (File) iterator.next();
    		System.out.println("File Found: " + pfile.getAbsolutePath());
    	     }
    	} catch (Exception e) {
    		e.printStackTrace();
    	}
        }
    }


    EDIT: oopss. wrong title.. sorry..
    Last edited by babywiz21; April 2nd, 2011 at 11:12 AM.


  2. #2
    Administrator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,297
    Thanks
    180
    Thanked 824 Times in 767 Posts
    Blog Entries
    5

    Default Re: Send Scanned File to E-mail

    Yes, you need the Apache commons library placed on your classpath (for org.apache.commons.io.FileUtils).

Similar Threads

  1. How to Send emails from Google Mail using JavaMail API
    By JavaPF in forum Java SE API Tutorials
    Replies: 3
    Last Post: February 26th, 2012, 03:21 PM
  2. [SOLVED] Server Client does not send file
    By Kakashi in forum What's Wrong With My Code?
    Replies: 0
    Last Post: March 10th, 2011, 11:38 AM
  3. Read Mail From A Folder
    By qwert678 in forum What's Wrong With My Code?
    Replies: 8
    Last Post: February 1st, 2011, 10:29 AM
  4. java mail
    By erinbasim in forum Java SE APIs
    Replies: 2
    Last Post: May 13th, 2010, 02:17 AM
  5. Javax.Mail Query Help Me Please
    By ravjot28 in forum What's Wrong With My Code?
    Replies: 10
    Last Post: January 19th, 2010, 10:06 AM