Remote Directory Watcher

Hi!
I have to implement a directory watcher, the directory being on a different remote server.
I found [this solution|http://twit88.com/blog/2007/10/02/develop-a-java-file-watcher/] (http://twit88.com/blog/2007/10/02/develop-a-java-file-watcher/) and was wondering if the directory declaration using the java.io.File class would accept, and if so how, a remote pathname?
If not, would there be another solution?
Thx.

If you're on a Windows machine and you're trying to access shared folders, then using the usual [UNC syntac|http://en.wikipedia.org/wiki/Path_(computing)#Uniform_Naming_Convention] for Windows will work with File objects i.e. you can create a new File() for \\myServerName\mySharedFolder
But keep in mind that this works because Windows handles the access to that folder, not Java. So if you're prompted for a username/password when you try to access the share in Windows Explorer, it'll most probably not work from within your Java app. And like I mentioned earlier, this will not work for non-Windows systems. You could give jCIFS a shot if you want to access Samba shares (this is what normal Windows shares also use) from any platform.
On a related note, keep in mind that Windows maintains a separate creation timestamp for files. But Java only lets you read the lastModified timestamp. Consider that I create a file at 4 PM (creation time) and then edit it at 5 PM (last modified). If I then make a copy of this file at 6 PM, this copy will have it's creation time set to 6 PM, but it'll have its last modified time set to 5 PM, the modified time of the original. Makes sense when you look it one way, but it could trip you up (like it did me :) ). If you must have the creation time instead of the last modified time, you can check out FileTimes by Roedy Green (of Canadian Mind Products fame) which uses JNI to get it.

Similar Messages

  • How can I get the remote directory from an FTPActivationSpec header?

    The header message generated for the oracle.tip.adapter.ftp.inbound.FTPActivationSpec contains the file name, FTP host and FTP port. Is there any way of getting the remote directory as well?
    <schema attributeFormDefault="qualified" elementFormDefault="qualified"
    targetNamespace="http://xmlns.oracle.com/pcbpel/adapter/ftp/"
    xmlns="http://www.w3.org/2001/XMLSchema"
    xmlns:FTPAPP="http://xmlns.oracle.com/pcbpel/adapter/ftp/">
    <element name="InboundFTPHeaderType">
    <complexType>
    <sequence>
    <element name="fileName" type="string"/>
    <element name="ftpHost" type="string"/>
    <element name="ftpPort" type="string"/>
    </sequence>
    </complexType>
    </element>
    </schema>
    This is already specified in the activation spec parameters:
    <activationAgents>
    <activationAgent className="oracle.tip.adapter.fw.agent.jca.JCAActivationAgent" partnerLink="ReadFileService">
    <property name="ftpRemoteDir" type="LogicalDirectory">out</property>
    <property name="portType">Read_ptt</property>
    </activationAgent>
    </activationAgents>
    But I don't want to have to add a separate preference parameter to hold the same thing if I don't have to. Alternatively, is there any way of querying the activation agent parameters from within an xpath expression, similar to "ora:getPreference()"?
    Cheers,

    add:
    <element name="directory" type="string"/>
    to the FTP adapter header WSDL

  • Finder not displaying all files in remote directory

    Sorry, this is a repost as I have gotten no response from my original request here: Finder not displaying all files in remote directory
    I've exported pictures from iPhoto on my iMac to a shared directory on my mac mini. When I access that directory from my iMac, I can see some but not all of the pictures. I know the pictures exported properly because I can see them all from the mac mini. I can open up a terminal window on my iMac and see all of the files; I can also open those files from the terminal.
    I'm running OSX 10.9.4 on both computers, with the mac mini also running OSX Server. I've placed a screen grab below from my iMac of what Finder sees vs what I can see from the terminal.
    Why isn't Finder displaying all of my files?

    thanks for responding
    Adding a new file to the shared folder results in me being able to see the new file from my clients regardless of where it was added from, however the "hidden" files do not suddenly pop up.
    I tried a few more experiments that had interesting results, but still didn't lead me to an answer.
    First I tried copying the files from the remote directory to a local directory; I did this in 2 different ways and had different results. Method A) I copied files from the mounted share to a local dir: "cp /Volumes/MyShare/dir/*.JPG .". Method B) I copied the files using secure copy: "scp user@server:/path/to/dir/*.JPG .".
    Method A resulted in Finder not being able to see the files in the local directory, while Method B did. This was interesting and lead me to suspect an issue with the way I am sharing the directory on the server. From Server settings I have both afp and smb checked. I tried enabling only one or the other and reconnecting; but this did not fix the problem.
    Next I tried exporting the photos from iPhoto again. Exporting them locally results in files that Finder can see. Exporting them to my server results the same bad behavior
    Getting desperate, I also tried renaming all of the files from "*.JPG" to "*.jpg" but this didn't help.
    One last experiment, I see the same behavior from both another Mac and a PC on my local network... FTP works fine.
    Any more ideas?

  • How to use remote directory for external table

    Hi Folks,
    I have 2 Oracle 11GR2 64 bit database installed on Win 2008 server as prod1 and prod2.
    I have one directory created on prod1 server as EXT_TAB_DIR using the path as D:\OrsDWtest_dir .
    I want to use this directory in Prod2 server and use external table using this remote directory.
    I am able to access the Prod1 directory from Prod2 machine and also i have created Network map drive as Z drive pointing to that prod1 D:\OrsDWtest_dir directory. Also i checked read and Write permissions are there . I am able to create the external table but when i try to fetch the data i m getting below error ..
    ORA-29913: error in executing ODCIEXTTABLEOPEN callout
    ORA-29400: data cartridge error
    KUP-04040: file IOMM_20121213_060736.csv in EXT_TAB_DIR not found
    now my doubt is this possible ? Can we use remote directory for External table ? or is there is there any alternative way to achieve same ?
    Thanks & Regards,
    Vikash Jain(DBA)

    could you confirm the name and the existence of this file "IOMM_20121213_060736.csv" ?
    same error like:
    http://www.oracle-base.com/articles/9i/external-tables-9i.php
    if the load files have not been saved in the appropriate directory the following result will be displayed.
    SQL> SELECT *
      2  FROM   countries_ext
      3  ORDER BY country_name;
    SELECT *
    ERROR at line 1:
    ORA-29913: error in executing ODCIEXTTABLEOPEN callout
    ORA-29400: data cartridge error
    KUP-04040: file Countries1.txt in EXT_TABLES not found
    ORA-06512: at "SYS.ORACLE_LOADER", line 14
    ORA-06512: at line 1Edited by: Fran on 10-ene-2013 23:32

  • Directory watch on another server

    OK, we have a weird situation. I am in an environment where
    we have ColdFusion MX 7 on our development server but CF 5 on our
    production servers. I have developed a directory watcher solution
    to automate one of my processes but it will be at least 6 months
    before we have converted our nearly 100 apps to MX. Can I use my
    development server running MX to watch a directory on another
    server? Perhaps using a UNC path in the config file?

    Hi,
    ups - forgotten this one. The running Oracle process does not have access privileges for mapped network drives by default. So you need to
    setup the Oracle service in a manner that the process can "see" the mapped network drives .. That is windows-specific ...
    Maybe these articles help ...
    http://asktom.oracle.com/pls/asktom/f?p=100:11:4352309546273981::::P11_QUESTION_ID:241814624807
    http://www.dbforums.com/oracle/983402-utl_file-network-copy-problem.html
    Does this help ..?
    Best regards
    -Carsten

  • Directory Watcher is Skipping files

    I've noticed the directory watcher is skipping files when a
    number of files appear in the directory in less than a minute. The
    first one or 2 are successfully processed, but the next one(s) are
    skipped.
    The timestamps on the files are like:-
    10:28:32 done
    10:29:06 done
    10:29:14 done
    10:29:17 skipped
    What is causing this and what can I do to fix it?
    Chris

    In article <fc5jdn$pjr$[email protected]>
    "105"<[email protected]> wrote:
    > I've noticed the directory watcher is skipping files
    when a number
    > of files appear in the directory in less than a minute.
    The first one
    > or 2 are successfully processed, but the next one(s) are
    skipped.
    Well, the directory watcher is supplied as an *example* and
    is not
    really intended to be production-quality code. The source is
    supplied
    so you are free to modify it yourself as needed.
    Sean A Corfield -- (904) 302-SEAN
    An Architect's View --
    http://corfield.org/
    cf.Objective() 2008
    Early May, near Minneapolis, MN
    The world's ONLY enterprise engineering conference for
    ColdFusion
    http://cfobjective.com/

  • How to make a remote panel file dialog open remote directory from any computer

    Hello to everybody. I am using Labview 6.1 and I would like to know how to make a remote panel file dialog open remote directory from any computer (Not only from a specific computer. If I open the file with a specific computer, I have to conect the path of the remote machine, but if I don´t know which remote computer is going to run the aplication, how can I do it?)?

    Hi!
    first you have to know progammatically the name of the remote pc connected to your server: this is a problem!
    I did not find a straigth way, LV 6.1 doesn't allow much progammatic control on the remote panel connection feature, but I'm confident that in the next LV version this will be improved!
    The point is that the Remote Panel Connection Manager (from the Tools menu) has all the informations about the connection: client name, server vi and whatever.
    This application is embedded in the \PROJECT\REMOTEPANEL.LLB and consists of a set of password protected vis.
    So here's the trick: use VIServer to grab data from the rpcm Get Server Data.vi when the Remote Panel Connection Manager is in run mode. By this you get all the informations (not only client name)o
    f the remote panel connection. See my example.
    By the way use client machine name to build the file dialog function input path.
    If anybody has an alternative method it would be more than appreciated to share it.
    Good luck,
    Alberto Locatelli
    Attachments:
    get_remote_machine_data.vi ‏151 KB

  • Make a remote panel file dialog open remote directory

    My remote panel file dialog opens in local directory
    How TO: Make a remote panel file dialog open remote directory? Ideas, examples, welcome.

    Hi!
    I have done that, but i have the same problem.
    I want to control an application from a remote machine. At the biguinning of the application, I have so open a File to save all the data to this file. When I run the application from the server machine, I have no problem, the dialog box "save as" opens and I save there my file with al the data, but when I control the application remotely, the dialog box "save as" does not open, and I get the error 43. Do you know what do I have to do if I want to run and control the aplication from a remote machine and save all the data in a file?
    Thanks a lot

  • Exception in thread "Native Directory Watcher"

    I've had issues before with old (several days) sql developer window becoming unresponsive and chewing up 100% cpu. The output window showed Exception in thread "Native Directory Watcher" repeadedly.
    Version 3.2.20.09
    jdk1.7.0_07

    Hi,
    Might there be a java.lang.OutOfMemoryError anywhere in the stack trace? That would explain the unresponsiveness and even possibly the 100% CPU issue (if OutOfMemory not on main thread). The CPU being pegged could be due to some never-ending Java garbage collection.
    If the product has been open for an extended period of time, then memory leaks or just having lots of connections/panes open may be the problem's source, whether or not there is an actual OutOfMemoryError.
    Regards,
    Gary
    SQL Developer Team

  • Is the directory watcher multi-threaded once it calls the cfc?

    the docs say there's a single thread that watches the directory.  But say for example it finds 3 files and calls the cfc.  At that point do all 3 files run one at a time on a single thread in the order they came in, or do they run at the same time on multi-threads?

    I think I understood your questions. There were more than one, some implicit. Here are my answers:
    ColdFusion runs the directory-watcher in a single thread.
    During the execution of the same thread, ColdFusion detects whether of not a file has, or any number of files have, been added, deleted or changed.
    When ColdFusion calls the CFC, it does so in that same single thread. My guess is that any file add-events, delete-events and change-events are queued and handled one after the other.

  • CF9 Directory Watcher randomly skips files

    I'm using the directory watcher gateway to log changed files as they are pushed (FTP'd) to a development server.  The gateway occassionally misses random files.  I've seen some older post where this was a problem and was looking to see if the problem still exists on CF9. The onAdd/onUpdate methods simply write the file details to a SQL database.  There is very little logic in the .cfc.
    If you FTP 10 files to the server it will tell you 8 changed.  If you push the same 10 again it will in some cases it will reconcile the missing files.  I have the intervalconfigured for 60 seconds.

    My problem was not "randomly skipping of files".  In the ColdFusion administrator under Event Gateways/Settings a parameter for "Maximum number of events to queue" is configured to 10 by default.  If you FTP more than 10 files in a timeframe under your configured run interval you will lose events.  My directory watcher was running every 60 seconds and it was common to FTP > 10 files in 60 seconds.  My solution was to increase the "Maximum number of events to queue" and decrease my run interval from 60 to 15.  The combination of these two configuration changes has fixed my missing files problem.

  • Directory watcher Flase event

    Hi,
    I am having a problem with directory watcher, environment is :
    Windows 2003
    Coldfusion 8.0.1
    Current scenario :
    My directory watcher is watching a shared folder (A) on network, and copies files from that folder to a different share folder (B) on network (Both shared folder are in different boxes)
    Problem :
    Sometime my onAdd fires at odd times and it starts copying all the files available on A folder to B. And when I check logs, that time no files were added in A folder.
    Problem is onAdd event fires any time and I dont know why its happening.
    Please Help.
    Some more info:
    I am not moving files from A to B, just copying, so old files remains in same folder, there are around 3000-4000 files as of now in A folder, and every day 10-12 files gets copy in A.

    In the onAdd method, get Coldfusion to
    read the file and then
    append it.
    <cffunction name="onAdd" output="no">
    <cfargument name="CFEvent" type="struct"
    required="yes">
    <cfset data=CFEvent.data>
    <cfset addedFile=data.filename>
    <cffile action = "read" file =
    "{absolute_path_to_watcher_dir}\#addedFile#" variable =
    "textToAdd">
    <cffile action = "append" file =
    "{absolute_path_to_some_other_dir}\someFile.txt" attributes =
    "normal" output = "#textToAdd#">
    </cffunction>

  • Remote Directory not accessable

    I am using application server 10g R1.
    To use form services when I add remote directory name(\\10.1.1.1\ebs) in formsweb.cfg file.
    It does't work and returns with error: invalid configuration.
    It's working fine with local dir name(like f:\ebs).
    How can I enable remote dir name.
    Please advice.
    Regards,
    Amit

    Can the machine that AS is running on access that share? Does the share require authentication?
    Have you checked the logfiles to see what they say?

  • Dbms_lob.FileOpen failed using remote directory in oracle 10g

    when i create a directory with the remote shared path like '\\kf-kjyxp\sharepath\temporary' . then in a pl/sql block i use dbms_lob.fileopen to open bfile object , a failure occurs .but the situation does not happen when i use a local diretory like 'd:\sharepath\temporary'.the most puzzling thing is that when i use dbms_lob.FILEISOPEN to check whether i can access the file ,it returns 1 which means succeed . And dbms_lob.GETLENGTH() also returns the right value.
    here is the testing code:
    declare
         pFile bfile;
         sDir varchar2(255);
         sFileName varchar2(255);
         bExist integer := 0;
         Amount Integer := 4000;
    begin
         sDir := 'SRC_PATH';
         sFileName := 'ele_onlinedoc.ico';
         pFile := bfilename(sDir, sFileName);
         --checking  file existence
         bExist := DBMS_LOB.FILEEXISTS(pFile);
         if bExist = 1 then
              dbms_output.put_line('File Exist');
         else
              dbms_output.put_line('File Not Exist');
         end if;
         --check file size
         Amount := dbms_lob.Getlength(pFile);
         dbms_output.put_line(TO_CHAR(Amount));
         if dbms_lob.FILEISOPEN(pFile) = 1 then
              dbms_output.put_line('File is already Opend');
         else
              dbms_output.put_line('File is closed');
         end if;
         dbms_lob.fileOpen(pFile,dbms_lob.file_readonly);
         dbms_lob.fileclose(pFile);
    EXCEPTION
         When VALUE_ERROR then
              dbms_output.put_line('Exception Value_error');
         When OTHERS then
              dbms_output.put_line('Exception OTHERS');      
              dbms_output.put_line(to_char(SQLCODE));
              dbms_output.put_line(sQLERRM);
    end;
    OUTPUT:
    File Exist
    1078
    File is closed
    Exception OTHERS
    -22288
    ORA-22288: file or LOB operation FILEOPEN failed
    we can see that file is detected and also we can get the right size(1078 byte) ,
    but fail to open the file.
    so what`s the problem .
    thanks!

    ORA-22288: file or LOB operation string failed string
    Cause: The operation attempted on the file or LOB failed.
    Action: See the next error message in the error stack for more detailed information. Also, verify that the file or LOB exists and that the necessary privileges are set for the specified operation. If the error still persists, report the error to the DBA.

  • How to list files from a remote directory?

    Hi,
    I have a user interface on a PC that needs to display a directory listing of a remote RT processor.  I don't want to have the RT to use List Directory function and the PC to get this result... I'm sure there's a cleaner way to do that with FTP or DataSocket.  I've tried FTP, but it stalls in FTP Directory Listing.vi.
    Any ideas?
    Thanks!
    Patrick.

    There are a number of reasons why the Directory lister can hang. The best thing to do is try the "FTP browser.vi" found in the example finder. If you have the internet toolkit it will show up if you search for "FTP." In this example program, type in your RT unit's IP address and see if you can browse the directory structure. If it works you can use any portion of this program in your own application. Hope this helps.

Maybe you are looking for

  • Now using imovie 11, how to import imovie projects which were created in an earlier version of iMovie?

    anyone got a similar situation?

  • PDF files are not displayed

    Firefox does not display PDF files. I did not have this problem before and tried just about everything that has been mentioned under help and in the forum - including a complete and clean reinstallation. So far NOTHING seem to have any effect. For a

  • DVD's and PS2 in Black and White on New Aquos

    I just purchased a 42" SHARP Aquos. I have my Direct TV DVR hooked up and TV looks and works great. I also have a 3 year old phillips tuner/dvd player and my PS2 hooked up to the tv and both play in black and white only. Everything worked fine on the

  • Cancel/Reversal of Invoice

    Hi All, I posted an invoice with MIR7 transaction code and now I want to calcel / reverse the same. When i go to MR8M to reverse the same, it gives me an error message, "Invoice document 5100100023 2010 does not exist". I also tried by using differen

  • Received a message with dismiss button. Is my iPhone hacked?

    Hello, I have Iphone4S with IOS 6.  Today I got a message "how are you2" with a dismiss button on it, which occupied the complete screen. Since i found it strange i managed to take a screenshot of it. I clicked on dismiss button and found no sign of