Interface File

    • Method Detail

      • moveTo

        File moveTo​(Folder folder)
        Description copied from interface: Resource
        Move this resource to the specified folder. Any duplicate Files will be replaced (existing Folder resources will be merged). If the resource does not exist a ResourceDoesNotExistException is thrown.
        Specified by:
        moveTo in interface Resource
        Parameters:
        folder - the folder to move the resource to
        Returns:
        a new resource (the current resource will no longer exist
      • copyTo

        File copyTo​(Folder folder)
        Description copied from interface: Resource
        Recursively copy this resource to the specified folder. Any duplicate Files will be replaced (existing Folder resources will be merged). If the resource does not exist a ResourceDoesNotExistException is thrown.
        Specified by:
        copyTo in interface Resource
        Parameters:
        folder - the folder to copy the resource to
        Returns:
        a new resource (the current resource will no longer exist
      • rename

        File rename​(java.lang.String name)
        Description copied from interface: Resource
        Rename the current resource. The rename operation cannot be used not move the resource to a different folder, use the Resource.moveTo(Folder) method to move the resource before renaming if required. Root folders cannot be renamed. If the resource does not exist a ResourceDoesNotExistException is thrown.
        Specified by:
        rename in interface Resource
        Parameters:
        name - the new name of the resource (this must not include any path elements)
        Returns:
        a new resource (the current resource will no longer exist
      • getSize

        long getSize()
        Returns the size in bytes of the virtual file.
        Returns:
        the size in bytes
      • getContent

        FileContent getContent()
        Provides access to file content. Calling any method on a file that does not exist will cause it to be created.
        Returns:
        the file content
      • copyToIfNewer

        Resource copyToIfNewer​(Folder folder)
        RCopy this file to the specified folder if this file is newer than the destination.
        Parameters:
        folder - the folder to copy the file to
        Returns:
        a new resource (the current resource will no longer exist
        Throws:
        ResourceDoesNotExistException - if this resource no longer exists