简体   繁体   中英

using BufferedReader read remote file metadata

I am reading file from remotely using BufferedReader and i can run every line of the file using below program.

public static void main(String[]args) throws IOException {

        URL url = new URL("http://www.statvision.com/webinars/countries%20of%20the%20world.xls");
        BufferedReader reader = new BufferedReader(new InputStreamReader(url.openStream()));
        long rowcount=0;
        while ((reader.readLine()) != null)
        {
            rowcount=rowcount+1;
        }
        reader.close();

        System.out.println(rowcount);

    }

But i want to read the remote file metadata. I mean i want to read file creating time,author name. But not get any way to read the remote file metadata!!

Any type of help or suggestion will be really appreciated

The metadata itself is stored in the file itself. You can use one of the Java libraries to open the file and extract the metadata. You can look at Apache POI for that.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM