Is there any way to automatically upload files from a folder?

I would to know if there is any way that nuxeo upload the files placed in a specific folder.


0 votes

2 answers



You can write a custom listener that runs on a timed basis. The listener scans the directory and ingests the files it finds in the directory.

For example…

// events contribution - this one runs once a day, but it could run on any schedule you need (e.g. every 5 minutes)

    <schedule id="concena_directoryimport">
        <cronExpression>0 30 6 * * ?</cronExpression>

    // listener contribution

    <listener name="concena_directoryimportlistener" async="true" postCommit="false"
        class="com.concena.core.directoryimport.DirectoryImportListener" priority="165">

    // listener snippet

    protected void handleDirectoryImportEvent(Event event) {


        // 2. collect up files in the template import directory
        // read through the specified directory and load file names into an array
        File directory = null;
        String[] files = null;

        directory = new File(getImportDirectory());
        files = directory.list(new ImportTemplateFileFilter()); // filter limits collection to Office Word and Excel templates


        // etc. - get a CoreSession, walk through the files, create documents from files, log results, etc.
2 votes

Thanks bruce, but I'm new in Nuxeo and I'm really lost. I will look at listeners documentation because I don't know where to start.


Laurent Doguin from Nuxeo recently posted an article about it on the Nuxeo blog, here is a link to it :

3 votes