How to get LastModified time of a file in repository(in weblogic8 and Compa
hi ,
my task is that i have to compare modified time of 2 file.one is in file system other is database file . which is most recently updated (which is newer).
details :
we have to check that which file is most recently updated .if database 's file is newer then we copy that file in to file system other wise we keep file system 's file as it is till database file is not updated
so that we can put the latest data in cache(which is in file system ) so we need not to access database again and again we just get data from our cache(or file system).
technical Detail:
my task is that i have to compare cache's file and repository's file . which is most recently updated (which is newer).
in all i have to done in weblogic server 8.2 's repository and file system(cache) .
i want to know that how we can check that when the file in repository last modified.
i want to check that node content of a particular repository (file /image/any data ) last modified by anyone , so that i can put the latest data in cache if cache 's file modified time
is less then repository's file modified .other wise no need to copy all file/data again and again ,if no modification .
If the file is in the resource path of a webapplication, then you can use
URL u = servletContext.getResource("path/to/resource");
URLConnection connection = u.openConnection();
connection.getLastModified()
If the webapp is exploded, then you can use the getRealPath() on servletContext to get the absolute path on the disk and create a File, then invoke lastModified() to get its timestamp.
-- Nagesh
Similar Messages
-
How to get LastModified time of a file in repository(in weblogic8.2 )
hi ,
my task is that i have to compare cache's file and repository's file . which is most recently
updated (which is newer).
in i have to done in weblogic server 8.2 's repository and file system(cache) .
details :
i want to know that how we can check that when the file in repository last modified.
i want to check that node content of a particular repository (file /image/any data ) last modified
by anyone , so that i can put the latest data in cache if cache 's file modified time
is less then repository's file modified .other wise no need to copy all file/data again ,if no
modification .Cross posted
http://forum.java.sun.com/thread.jspa?threadID=5126507 -
How to get endtime of a redolog file
How to get endtime of a redolog file..
i get start time from the following statement..but the high time shows as
01-JAN-1988 00:00:00
select TO_CHAR(LOW_TIME,'DD-MON-YYYY HH24:MI:SS'),TO_CHAR(HIGH_TIME,'DD-MON-YYYY HH24:MI:SS') from v$logmnr_logs;
where do i get the correct end timei need the high time of the current redo log..using the folowing query i get
select min(to_char(first_time, 'DD-MON-YY HH24:MI')),
max(to_char(first_time, 'DD-MON-YY HH24:MI')),MEMBERS from v$log
group by members;
MIN(TO_CHAR(FIR MAX(TO_CHAR(FIR MEMBERS
28-NOV-07 09:33 28-NOV-07 12:19 1
it returns the max and min low time among all redo logfiles
what I need is the high time of current log file.
using the next query i get
select min(TO_CHAR(LOW_TIME,'DD-MON-YYYY HH24:MI:SS')),max(TO_CHAR(LOW_TIME,'DD-MON-YYYY HH24:MI:SS')) from v$logmnr_logs;
28-NOV-2007 12:19:09 28-NOV-2007 12:19:09
since i add only current log file to log mining session, v$logmnr_logs would only have information about that file(one row only). so will get same time here for min and max. What i need here is high_time of the current redo log file.
Any idea? -
How to get Header in Downloaded .xls file using GUI_Download function
How to get Header in Downloaded .xls file using GUI_Download function ???
How to use the the Header parameter available in GUI_Download function .HI,
see this sample code..
data : Begin of t_header occurs 0,
name(30) type c,
end of t_header.
data : Begin of itab occurs 0,
fld1 type char10,
fld2 type char10,
fld3 type char10,
end of itab.
DATA: v_pass_path TYPE string.
append itab.
itab-fld1 = 'Hi'.
itab-fld2 = 'hello'.
itab-fld3 = 'welcome'.
append itab.
append itab.
append itab.
append itab.
append itab.
t_header-name = 'Field1'.
append t_header.
t_header-name = 'Field2'.
append t_header.
t_header-name = 'Field3'.
append t_header.
CALL FUNCTION 'GUI_FILE_SAVE_DIALOG'
EXPORTING
default_extension = 'XLS'
IMPORTING
fullpath = v_pass_path.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filename = v_pass_path
filetype = 'DBF'
TABLES
data_tab = itab
FIELDNAMES = t_header
Cheers,
jose. -
How to get field separator in flat file using GUI_DOWNLOAD function
hi,
how to get field separator in flat file using GUI_DOWNLOAD function.
thanking you.Hi,
Use WRITE_FIELD_SEPARATOR = 'X'.
Check this sample code
REPORT z_file_download.
DATA: w_name(90) TYPE c.
DATA:
BEGIN OF fs_flight,
carrid LIKE sflight-carrid,
connid LIKE sflight-connid,
fldate LIKE sflight-fldate,
price LIKE sflight-price,
currency LIKE sflight-currency,
END OF fs_flight.
DATA:
BEGIN OF fs_head,
carrid(10) TYPE c,
connid(10) TYPE c,
fldate(10) TYPE c,
price(10) TYPE c,
curr(10) TYPE c,
END OF fs_head.
DATA:
t_head LIKE
TABLE OF
fs_head.
DATA:
t_flight LIKE
TABLE OF
fs_flight.
fs_head-carrid = 'CARRID'.
fs_head-connid = 'CONNID'.
fs_head-fldate = 'FLDATE'.
fs_head-price = 'PRICE'.
fs_head-curr = 'CURRENCY'.
APPEND fs_head TO t_head.
SELECT-OPTIONS:
s_carrid FOR fs_flight-carrid.
START-OF-SELECTION.
SELECT carrid
connid
fldate
price
currency
FROM sflight
INTO TABLE t_flight
WHERE carrid IN s_carrid.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
* BIN_FILESIZE =
filename = 'D:\flight.xls'
FILETYPE = 'ASC'
* APPEND = ' '
WRITE_FIELD_SEPARATOR = 'X'
* HEADER = '00'
* TRUNC_TRAILING_BLANKS = ' '
* WRITE_LF = 'X'
* COL_SELECT = ' '
* COL_SELECT_MASK = ' '
* DAT_MODE = ' '
* CONFIRM_OVERWRITE = ' '
* NO_AUTH_CHECK = ' '
* CODEPAGE = ' '
* IGNORE_CERR = ABAP_TRUE
* REPLACEMENT = '#'
* WRITE_BOM = ' '
* IMPORTING
* FILELENGTH =
tables
data_tab = t_head
EXCEPTIONS
FILE_WRITE_ERROR = 1
NO_BATCH = 2
GUI_REFUSE_FILETRANSFER = 3
INVALID_TYPE = 4
NO_AUTHORITY = 5
UNKNOWN_ERROR = 6
HEADER_NOT_ALLOWED = 7
SEPARATOR_NOT_ALLOWED = 8
FILESIZE_NOT_ALLOWED = 9
HEADER_TOO_LONG = 10
DP_ERROR_CREATE = 11
DP_ERROR_SEND = 12
DP_ERROR_WRITE = 13
UNKNOWN_DP_ERROR = 14
ACCESS_DENIED = 15
DP_OUT_OF_MEMORY = 16
DISK_FULL = 17
DP_TIMEOUT = 18
FILE_NOT_FOUND = 19
DATAPROVIDER_EXCEPTION = 20
CONTROL_FLUSH_ERROR = 21
OTHERS = 22
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filename = 'D:\flight.xls'
filetype = 'ASC'
append = 'X'
write_field_separator = 'X'
TABLES
data_tab = t_flight
EXCEPTIONS
file_write_error = 1
no_batch = 2
gui_refuse_filetransfer = 3
invalid_type = 4
no_authority = 5
unknown_error = 6
header_not_allowed = 7
separator_not_allowed = 8
filesize_not_allowed = 9
header_too_long = 10
dp_error_create = 11
dp_error_send = 12
dp_error_write = 13
unknown_dp_error = 14
access_denied = 15
dp_out_of_memory = 16
disk_full = 17
dp_timeout = 18
file_not_found = 19
dataprovider_exception = 20
control_flush_error = 21
OTHERS = 22.
IF sy-subrc EQ 0.
MESSAGE 'Download successful' TYPE 'I'.
ENDIF.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF. -
how 2 get the path of a file Using jsp
i have tried getPath...but i'm geting the error
The method getPath(String) is undefined for the type HttpServletRequest
any idea how 2 get the path of a fileYou need ServletContext#getRealPath().
API documentation: http://java.sun.com/javaee/5/docs/api/javax/servlet/ServletContext.html#getRealPath(java.lang.String) -
How 2 get the path of a file Using jsp
how 2 get the path of a file Using jsp
i have tried getPath...but i'm geting the error
The method getPath(String) is undefined for the type HttpServletRequest
any idea how 2 get the path of a fileYou need ServletContext#getRealPath().
API documentation: http://java.sun.com/javaee/5/docs/api/javax/servlet/ServletContext.html#getRealPath(java.lang.String) -
How To: Get encoding of a remote file
How To: Get encoding of a remote file
Java EE
URL url = new URL ("http://www.someSite.com/myCsvFile.csv"); // comma separated
InputStream is = url.openConnection().getInputStream();
InputStreamReader reader = new InputStreamReader(is);
System.out.println("reader.getEncoding(): " + reader.getEncoding());
For both an ISO-8859-1 file and a UTF-8 file I get the following print out:
reader.getEncoding(): Cp1252
Could it have something to do with this warning during boot the .war?
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
If I use local files it prints ISO8859_1 for one of the files.All of that is because the HTTP server attaches a charset to every response. That's what you are seeing. The server may be using some logic to determine the actual encoding of the file it returns, or it may simply be using a hard-coded charset which may or may not be suitable for reading the file. The latter is unfortunately more likely.
By the way if you receive an XML file over HTTP, and the HTTP charset differs from the encoding declared in the XML document, there's a rule which says the HTTP charset takes precedence. (I don't know where that rule is documented, but I have encountered that situation in real life -- the data came from a Google application -- and that rule was indeed the right thing to do.)
If you're still under the impression that there's something which can look at a file and determine what encoding was used to produce it, let me tell you that there isn't. Sure, there's that XML prolog thing which works for XML files (if they weren't botched by the producer), but for text files in general there's no way to determine their encoding. Short of asking the person who created them, that is. -
How can get a database like ****.SQL file for test in sqlplus in oracle8i
How can get a database like ****.SQL file for test in sqlplus in oracle8i,I am a beginner,thanks
I'll give it a guess as to what it is you want but I'm afraid you'll have to give some more information to go on. I appreciate it's difficult for people who are beginners or who don't have English as their first language.
Are you trying to run a SQL file? From SQL*plus you can do either of these:
SQL> start my_file
or
SQL> @my_file
N.B.: if th efile has a .sql extension you don't need to include it, but you do for any other file extension e.g.
SQL> @myfile.run
Here is the page Vijay referred to:
Re: Physical storage Checks & adding disk on server. I hope you find it useful.
You will more helpful links (including links to the Oracle on-line manuals at this page:
Re: How to attach a java bean in forms6i
good luck, APC -
How to get VQE-C SDK .tgz file
hi, out company plans to integrate VQE-C in IPTV STB, so how to get VQE-C SDK .tgz file?
Thx, Jerryany feedback pls :)
-
How to get current time and date??
How to get current time and date from my PC time and date to the java application??
i use java.util.* package but got error, that is:
- java.util.* and java.sql.* class are match
- abstract class cannot be instantiated
so what can i do, pls guide...thanks...There is a method in the System class that will return the current system time. You could also instantiate a Date, Time, Timestamp, or Calendar object, all of which get created with the system time by default.
Don't import *. Import the specific classes you need.
Next time, post the actual text of the exceptions/compile errors. If you make people guess, most just won't bother. -
How to get server time in Oracle Internet Directory (OID)?
Hi,
How to get current time on OID server? As in case AD, RootDSE contains currentTime attribute, Is there any attribute in OID through which I can get current time on server.
Thanks in advance for any help.
Regards,
UmeshHi,
wrong forum, use Identity Manager
Frank -
How i get some informations about audio file?
Hi to all,
i would like to know how i get some informations about audio file, such as its artist, bitrate, file type, duration, ecc...
Any help me?Ok, but which are the docs of audio format?Again, what does that have to do with Java?
Where i can found these documents?Again, what does that have to do with Java?
Thank you...For nothing.
db -
How to get a time from a NTP server in ActionScript 3 ?
Dear All,
I need your advice, how to get the time from NTP Server , I tried to do this, but I don't.
Thanks
Omar Mahmoudyou must use a server-side language supported by your server. php is a commonly supported language on most servers.
php tutorials can be found via google or any other search engine. -
Hi all,
I have problem how to get duration time between 2 date time (calendar):
example :
Calendar startDateTime
Calendar stopDateTime
how to get :
???? duration = stopDateTime - startDateTime
Thanks beforeCalendar one = new GregorianCalendar();
Thread.currentThread().sleep( 1000 );
Calendar two = new GregorianCalendar();
long time = two.getTimeInMillis() - one.getTimeInMillis();
System.out.println( "Hrs " + Math.round( time / ( 1000 * 60 * 12 ) ) );
System.out.println( "Mins " + Math.round( time / ( 1000 * 60 ) ) );
System.out.println( "Secs " + Math.round( time / 1000 ) );
System.out.println( "MSecs " + time );
Maybe you are looking for
-
VGA adapter made for IPAD for 2nd GENERATION IPOD TOUCH
can I use the VGA adapter made for IPAD for 2nd GENERATION IPOD TOUCH
-
Automatic query depending on selection of another item
Hi all, I have the following situation : I have two items in a form called P42_ASUNTO and p_42_COD_OFERTA. P42_ASUNTO is a select list and P42_COD_OFERTA also. I would like that when it selects across the list of P42_ASUNTO, automatically only there
-
DPM 2012 R2 agent update on Windows 2003 server x64
Hi, I have an old windows 2003 server x64 protected by DPM 2012 Sp1. After DPM upgrade to 2012 R2 I cannot update DPM Agent on server. If I try to update agent manually error message is : agentsetup.exe is not a valid win32 application. Mihai
-
HT201274 I do the Erase All Content and Settings, How can i restart my i phone 3s?
I do the Erase All Content and Settings, How can i restart my i phone 3gs?
-
Hi , We are implementing E-recruitment Ehp5 system. When the external candidate register, he will get a mail for E-mail Confirmation for completing the registration process. But when the candidate click on E-mail verification Link, The username and p