Finding and showing file date/time i'm referencing on

How can I find and show on page the date and time parameters of file on which i'm referencing with using an JSP? I tried it with java.io.*,
<%@ page import="java.io.*"%>
<%@ page import="java.awt.*,javax.swing.text.*"%>
<%@ page contentType="text/html; charset=windows-1250"%>
<%
File u_file=new File("http://oracle1/pn/index.html");
long dat=u_file.lastModified();
Date u_date=new Date(dat);
%>
<%=u_file.getPath()%>
<%=u_file.getName()%>
<%=u_file.isFile()%>
<%=u_date%>
but the date was always 0(1.1.1970) ,result of isFile was null, but result of Pathname and Name was correct.
What is wrong?

From the JSP, if you say, File file = new File(path);
It will try to search for the file starting from the bin directory (I am using tomcat). So, you need to give the full path to the file from there.
For example, if your file is in, webapps/examples/html/ directory, you need to use something like this,
File file = new File("../webapps/examples/html/index.html");
You can't give URL as the file name/path. You can't access Oracle's file system!!!
Hope this helps.
Sudha

Similar Messages

  • Finder and wrong Created dates/times

    I've noticed this glitch in Tiger and Snow Leopard, and it has remained in Lion.  When I have a Finder window open (whether in List or Column view), I notice that a number of files show the Created date and time as 12-31-69 5:00 PM.  Even if I check the file info (Command-I), I get the same results.  Yet when I import a photo file with such a date/time into say Aperture or Lightroom, for example, the original created date is proper, which tells me that my Mac isn't corrupting this information, it's just not rendering it properly in Finder.
    Anyone else having this problem with Finder?  More importantly, does anybody know if there is a fix for this?

    Copying files from a backup should not alter the created/modified dates, I just tested that.
    Why don't you try a TM restore on one of the files and see if it works.

  • I deleted the photos via Finder and empty trash long time ago. The thing is, that I want to recover one event or album.  The event appears in the iphoto but when open, it shows "!". Is it possible to recover the photos?

    I deleted the photos via Finder and empty trash long time ago. The thing is, that I want to recover one event or album.  The event appears in the iphoto but when open, it shows "!". Is it possible to recover the photos?

    No.  When you removed the photos via the finder you damage the library.  Photos should always be removed from the library using iPhoto, never with the Finder.
    If you have a Time Machine backup of the library from before you deleted the photos you can restore the library to the Desktop and export that album from it to import into your current library.
    It's been too long to be able to try one of the file recovery applications.  You sure to have overwritten those files with new files since them.
    OT

  • FINDER: File Date & Time Slow to Update

    In finder windows my date and time is slow to "update" when I've changed a file. Viewing by "Date Modified" is worthless sometimes. I change & save a file, view in finder and the date & time has not updated. Update times vary from immediate to minutes...
    Surely this isn't typical? The systme can't handle getting file date&time updated?
    10.4.7 on Dual 1Gz machine.
    comments?

    Hi, Greg.
    I've seen this happen from time to time myself. In my case it has been very rare and I've been unable to pin down a cause. It appears to be a bit of a glitch in Finder. It's usually seen with server-mounted volumes even though it was supposedly fixed in Tiger after being a regular issue with shared volumes in Panther.
    Some ideas:
    • Temporarily switching the View from say List to Icon and Back often corrects this.
    • You might want to take a look at Nudge.
    • If it's happening at high frequency, purging your Finder preferences may help. See my "Finder Issues? How to delete its preferences" FAQ.
    • You may want to try Path Finder, an alternative Finder. You can use Finder and Path Finder simultaneously.
    Good luck!
    Dr. Smoke
    Author: Troubleshooting Mac® OS X
    Note: The information provided in the link(s) above is freely available. However, because I own The X Lab™, a commercial Web site to which some of these links point, the Apple Discussions Terms of Use require I include the following disclosure statement with this post:
    I may receive some form of compensation, financial or otherwise, from my recommendation or link.

  • My external hard drive is 'seen' by my iMac and I can go into the Finder and open files and folders. I am using the hard drive for Time Machine back up. However Time Machine says it can't find the drive. Same thing has happened with Final Cut Express.

    My new LaCie external hard drive is 'seen' by my iMac and I can go into the Finder and open files and folders. I am using the hard drive for Time Machine back up. However Time Machine says it can't find the drive.
    The same thing happened recently between Final Cut Express and my other LaCie external hard drive used as the Scratch disk. It fixed itself.
    I've run out of ideas. Help would be very much appreciated. Thanks.

    have you done some searches on FCPx and time machine? Is there a known issue with using a TM drive with FCPx? dunno but ...wait...I'll take 60 sec for you cause I'm just that kind of guy....   google...." fcpx time machine problem"  Frist page link 
    http://www.premiumbeat.com/blog/fcpx-bug-best-practices-for-using-external-hard- drives-and-final-cut-pro-x/
           You cannot have time machine backups on your hard drive if you intend to use it in FCPX.
    booya!

  • How to find the last update date time and user of record field peoplecode

    how to find the last update date time record field peoplecode?
    Thank you.

    One can check the last update date time using the following query
    SELECT LASTUPDDTTM FROM PSPCMPROG WHERE OBJECTVALUE1 LIKE 'RECNAME' AND OBJECTVALUE2 LIKE 'FIELDNAME'

  • After updating to Yosemite, I updated iPhoto. Alert said to convert my library to new iPhoto. Then alert said I needed to repair permissions. Then a freeze. Then iPhoto won't find and show my library. How do I fix this?

    After updating to Yosemite, I updated iPhoto. Alert said to convert my library to new iPhoto. Then alert said I needed to repair permissions. Then a freeze. Then iPhoto won't find and show my library. How do I fix this? I can see the library icon on my external drive, but it doesn't show as a library in iPhoto. When I double click on the icon, nothing happens. When I choose it from alternate menu, doesn't open. Where do I get help?

    Peter
    Do you have a back up? What version of iPhoto do you have? Assuming 09 or later:
    Option 1
    Back Up and try rebuild the library: hold down the command and option (or alt) keys while launching iPhoto. Use the resulting dialogue to rebuild. Choose to Repair Database. If that doesn't help, then try again, this time using Rebuild Database.
    If that fails:
    Option 2
    Download iPhoto Library Manager and use its rebuild function. (In early versions of Library Manager it's the File -> Rebuild command. In later versions it's under the Library menu.)
    This will create an entirely new library. It will then copy (or try to) your photos and all the associated metadata and versions to this new Library, and arrange it as close as it can to what you had in the damaged Library. It does this based on information it finds in the iPhoto sharing mechanism - but that means that things not shared won't be there, so no slideshows, books or calendars, for instance - but it should get all your events, albums and keywords, faces and places back.
    Because this process creates an entirely new library and leaves your old one untouched, it is non-destructive, and if you're not happy with the results you can simply return to your old one.  
    Regards
    TD

  • BB off for a few days -- When turn on reconciled emails all show one date/time.

    If I am away for a few days -- with the Blackberry off -- Then when I return and turn on the unit, it will reconcile email through my work blackberry server.  The emails that get downloaded at that time all show on my blackberry email listing as received at one time -- when the reconciliation occurred -- not the dates/times that the actual emails were written.  My work email (on my computer at work) will show the dates/times that the actual emails were written -- even though I also had been logged out from my work email for the time I was away.  This is a real pain for viewing / looking through and finding emails later on the device.  So now, I have to leave the unit on and plugged into the wall when away -- so my emails will show the right date/time on the device.  Is there a way to set things up so I don't have to resort to this? -- seems to me that there must be -- otherwise a lot more people would raise this concern.
    Thanks,

    The last time I checked the incoming emails will always go by the date/time on the device itself. There is not a way to change this behavior.
    Do you turn it off to conserve battery power? If so you can always place the device in Standby mode. The battery drains much slower in this mode and should last anywhere from 10-15 days.
    If someone has been helpful please consider giving them kudos by clicking the star to the left of their post.
    Remember to resolve your thread by clicking Accepted Solution.

  • How do I get it to show the date & time.

    How do I get it to show the date & time at all times. I don't want to have to click on the day & time to get the date. In the OS 10.4 I could at least get it in the "analog" format. Under leopard it just show a little clock that can't be read.
    I just want to see the time and date at all times in the upper corner on the screen

    Please see my post in your first posting at http://discussions.apple.com/thread.jspa?threadID=1237022&tstart=0
    David

  • It seems that the last message sent in imessage doesn't show the date/time.

    When I look at the imessage screen it doesn't show the date/time on last messages.

    Claudia252 wrote:
    Thank you. I cant figure out how to change the lable infront of the number to "iPhone" . It shows "home", "work", "pager", etc. but it doesn't show an "iPhone" option.
    In the Contact, tap Edit.
    Tap the label in front of the number and another Label screen apears.
    Tap the label you want to use.

  • I burnt CDs thru Finder and IPhoto. Each time the titles failed to transfer. Why?

    I burnt CDs thru Finder and IPhoto. Each time the titles failed to transfer. Why?

    Where are you looking for the Titles? You're not confusing titles - which are an entry in the Exif metadata of the file - with Filename?
    Regards
    TD

  • Aborting index build. Too many errors with finding and copying files ...

    Hi dears,
    I'm using UCM 11g.
    I'm trying to start the automatic update cycle. When i start it, it gives me an error message just like :
    Indexing aborted at :<time>. Aborting index build. Too many errors with finding and copying files to the appropriate place.+
    Can anybody help me about this problem?
    Helps will be appreciated.
    Erdo
    Edited by: erdo on 28.Mar.2013 11:11

    Read this: error in Collection Rebuild Cycle
    and maybe also UCM Indexer - Collection Rebuild Cycle errorring out

  • I can't seem to open (view) my photos.  I get an error message that says "the file couldn't be opened because you don't have permission to view it. To view or change permission, select the item in the finder and choose File. Get info."

    I can't seem to open (view) my photos.  I get an error message that says "the file couldn't be opened because you don't have permission to view it. To view or change permission, select the item in the finder and choose File. Get info."  I have never had this happen before?  Thanks!

    Try the following:
    1 - launch iPhoto with the Command+Option keys held down and rebuild the library.
    2 - Run Option #1, Repair Permissions.
    OT

  • Cannot reinstate catalog after returning PC (Windows 7) to factory settings (because of worm infection). Catalog was backed up on external drive but not using PSE backup facility. Cannot find and *.tly file. Is this hopeless?

    Cannot reinstate catalog after returning PC (Windows 7) to factory settings (because of worm infection). Catalog was backed up on external drive but not using PSE backup facility. Cannot find and *.tly file. Is this hopeless?

    If you made backups of all of your photos and your catalog file using some third-party method (i.e. not using the PSE catalog backup command), then you should be able to restore everything.
    Step 1. Put the photos in the EXACT SAME LOCATION as before. For example, if they were in subfolders of C:\Users\<username>\Documents, then they must go into the exact same subfolders of C:\Users\<username>\Documents.
    Step 2. Move the catalog file to wherever you want it to be, and then double-click on it.

  • I can not open documents I get a message that says To view or change permissions, select the item in the Finder and choose File Get Info.  help

    I have a mac with os X.  I have saved documents and photos on my computer and am now not able to open them.  I get a message that tells To view or change permissions, select the item in the Finder and choose File > Get Info.  I do that and it is not locked.  confused.  help

    In the Info window it's this:
    Do you have read and write privileges?

Maybe you are looking for

  • Mail not showing new mail until I switch out of and back into INBOX

    When new mail is downloaded, the messages do not appear in the INBOX until I have moved to (clicked on) another mailbox and then moved back to INBOX. The unread message count reflects the correct number of unread messages until the above procedure ha

  • Run the Report through a button in form 6i

    Dear friends i am using oracle 6i and i want to run a report through a buton on form 6i

  • UNIX command for disabling Firewall in Leopard?

    I'd like to use ARD to send a unix command to all my Macs running Leopard that will set the OS's application firewall to "allow all incoming connections." I believe that's the default setting, but I've run into some machines that are setting specific

  • NQS ERROR

    i'm facing this error "nqserror-37001-could not connect to the oracle BI server instance" could any one guide how to resolve this. i restarted all the things in my services and i'm able to work off line. when I press online that error is triggering.

  • Safari crashes in Mountain Lion

    Hi folks, My Safari in Mountain Lion is crashing every time I try to start it. I've tried all the usual solutions, but nothing seems to solve it. Crash log is below - thanks! Process:         Safari [2550] Path:            /Applications/Safari.app/Co