Options
All
  • Public
  • Public/Protected
  • All
Menu

Class AutoFolderNest

An auto managed folder nest used for temporarily storing _files.

Hierarchy

Index

Constructors

constructor

Properties

Protected _id

_id: string

Protected _name

_name: string

Protected _tunnel

_tunnel: Tunnel

Protected allowCreate

allowCreate: boolean

Protected e

Protected heldJobs

heldJobs: FileJob | FolderJob

Protected hierarchy

hierarchy: string | string[]

Protected hierarchyString

hierarchyString: string

Protected path

path: string

Accessors

id

  • get id(): string

name

  • get name(): string
  • set name(name: string): void

tunnel

Methods

arrive

Protected checkDirectorySync

  • checkDirectorySync(directory: any): void

Protected createJob

  • createJob(path: string, arrive?: boolean): any
  • Function that creates and arrives new jobs. Can produce file or folder jobs.

    Parameters

    • path: string
    • Default value arrive: boolean = true

    Returns any

getHeldJob

  • getHeldJob(jobId: string): any
  • Get a held job with a job id. Removes it from the held job queue, so you should move it out of the folder after using this.

    Parameters

    • jobId: string

    Returns any

    Example

    var tunnel = af.createTunnel("Checkpoint example");
    var webhook = af.createWebhookNest(["test", "example"], "get");
    var holding_folder = af.createAutoFolderNest(["test", "checkpoint"]);
    
    var im = webhook.getInterfaceManager();
    
    // Watch for jobs, hold, and provide to the interface.
    im.checkNest(holding_folder);
    tunnel.watch(webhook);
    
    tunnel.run(function(job, nest){
         // Get the job_id from the webhook request
         var job_id = job.getParameter("job_id");
         // Get the held job from the holding folder
         var checkpoint_job = holding_folder.getHeldJob(job_id);
         // Move somewhere else
         checkpoint_job.move(af.createAutoFolderNest(["test", "outfolder"]));
    });
    

getHeldJobs

getUnwatchedJobs

  • getUnwatchedJobs(): Array<any>

Protected holdJob

Protected isUnixHiddenPath

  • isUnixHiddenPath(path: string): boolean
  • Checks whether a _path starts with or contains a hidden file or a folder.

    Parameters

    • path: string

      The _path of the file that needs to be validated. returns {boolean} - true if the source is blacklisted and otherwise false.

    Returns boolean

load

  • load(hold?: boolean): void
  • Initial load of the contents of the directory.

    Parameters

    • Default value hold: boolean = false

      Optional flag to hold jobs found.

    Returns void

register

  • register(tunnel: Tunnel): void

take

toString

  • toString(): string

watch

  • watch(hold?: boolean): void

watchHold

  • watchHold(): void

Generated using TypeDoc