Current Position:Home > How to check files in the directory using JSP?.

How to check files in the directory using JSP?.

Update:10-11Source: network consolidation
Advertisement
Hi,
How can i check the file is directory or file and readable or writable and file size and type of file(Ex. jpg, txt, doc., etc). i want to list the specific type of file in the particular directroy.. please help me..
Regards
CHinna

The Best Answer

Advertisement
With the File class, using the methods isFile(), isDirectory(), canRead(), canWrite(), length() and getName()
With File.listFiles() you can get a directory listing. If you want to limit the amount of files returned, you can pass your own FileFilter to it.
http://java.sun.com/javase/6/docs/api/java/io/File.html
  • How to check files in the directory using JSP?. Update:10-11

    Hi, How can i check the file is directory or file and readable or writable and file size and type of file(Ex. jpg, txt, doc., etc). i want to list the specific type of file in the particular directroy.. please help me.. Regards CHinnaWith the File cl

  • Check file in unix directory Update:11-30

    Hi all, I am dealing with checking file in certain directory path of the unix. If file can be found then has to be uploaded. How to get list of those files in the unix and based on these information, I will do open dataset. thanks alots. AliaHi Alia,

  • Checking Number of Files in a Directory Update:10-11

    Hi How can I read the filenames in a directory and determine the number of files in this directory.I need to put all the filenames in a drop down list box on a JSP. Please AdviseFilenameFilter filter = new FilenameFilter() {   public boolean accept(F

  • Error in sender file adapter: source directory does not exist Update:10-11

    Hi, The PI system is 7.11 I've created sender file adapter with following details: Transport Protocol : File System Source directory: /interfaces/In I checked in AL11 that this path really exists and it does. (I can even see the .txt file that should

  • Anyone knows how to delete a file from a directory????? Update:10-11

    hi there anyone has any idea on how to delete a file from a directory? delete(String filename)? thank you.Hi, Check this link. Gives you an example code to show how to delete a file. http://examples.oreilly.com/jenut/Delete.java Hope this helps. Roop

  • How can I get a file to copy all of the files in a directory except itself and the source of the copy function will be the directory the final program is in? Update:10-11

    How can I get a file to copy all of the files in a directory except itself and the source of the copy function will be the directory the final program is in? This application must be in Lab View 8.you mean something like this (see below)? Now you may

  • How can i traverse between files in a directory Update:10-11

    how can i traverse between files in a directory. I ahve seen in the site that isFile can be used to switch from one file to other but i didn't found such method. I am working in Eclipse. I would be thankful if u send me the solution.I mean the way to

  • Error in file receiver adapter (Directory does not exist / cannot be create Update:10-11

    I have a NFS reiceiver file NFS adapter with target directory: 10.128.68.38\arbo2000\UploadPinfos\arbodev if I run this line in windows, windows access to this folder. Full Error log: Receiver Adapter v2123 for Party '', Service 'BS_0000_ARBO_DEV': C

  • Get file list from directory(t.code: AL11). Update:10-11

    Hi Frnds, i need to get the list of file for particular directory from t.code AL11, is there any Function Module to display the list of File from  the directory in executable program, i have directory like '/home/im3/hrintf/processed/..... ' and now

  • Check file name format Update:10-11

    1)I have to check if a file exists else terminate the job 2)if file exists then check the format and if format is incorrect, give the message. i.e, i need to check whether filename is having correct format. for e.g: ABCDddmmyy.txt Every file in folde