Module tdlight.api

Class TdApi.OptimizeStorage

Enclosing class:
TdApi

public static final class TdApi.OptimizeStorage extends TdApi.Function<TdApi.StorageStatistics>
Optimizes storage usage, i.e. deletes some files and returns new storage usage statistics. Secret thumbnails can't be deleted.

Returns StorageStatistics

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    long[]
    If non-empty, only files from the given chats are considered.
    int
    Same as in getStorageStatistics.
    static final int
    Identifier uniquely determining type of the object.
    int
    Limit on the total number of files after deletion.
    long[]
    If non-empty, files from the given chats are excluded.
    If non-empty, only files with the given types are considered.
    int
    The amount of time after the creation of a file during which it can't be deleted, in seconds.
    boolean
    Pass true if statistics about the files that were deleted must be returned instead of the whole storage usage statistics.
    long
    Limit on the total size of files after deletion, in bytes.
    int
    Limit on the time that has passed since the last time a file was accessed (or creation time for some filesystems).
  • Constructor Summary

    Constructors
    Constructor
    Description
    Optimizes storage usage, i.e.
    OptimizeStorage(long size, int ttl, int count, int immunityDelay, TdApi.FileType[] fileTypes, long[] chatIds, long[] excludeChatIds, boolean returnDeletedFileStatistics, int chatLimit)
    Optimizes storage usage, i.e.
    Optimizes storage usage, i.e.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
     
    int
    Returns an identifier uniquely determining type of the object.
    int
     
    void
    Serialize the TDLib class

    Methods inherited from class it.tdlight.jni.TdApi.Function

    toString

    Methods inherited from class it.tdlight.jni.TdApi.Object

    serialize

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • size

      public long size
      Limit on the total size of files after deletion, in bytes. Pass -1 to use the default limit.
    • ttl

      public int ttl
      Limit on the time that has passed since the last time a file was accessed (or creation time for some filesystems). Pass -1 to use the default limit.
    • count

      public int count
      Limit on the total number of files after deletion. Pass -1 to use the default limit.
    • immunityDelay

      public int immunityDelay
      The amount of time after the creation of a file during which it can't be deleted, in seconds. Pass -1 to use the default value.
    • fileTypes

      public TdApi.FileType[] fileTypes
      If non-empty, only files with the given types are considered. By default, all types except thumbnails, profile photos, stickers and wallpapers are deleted.
    • chatIds

      public long[] chatIds
      If non-empty, only files from the given chats are considered. Use 0 as chat identifier to delete files not belonging to any chat (e.g., profile photos).
    • excludeChatIds

      public long[] excludeChatIds
      If non-empty, files from the given chats are excluded. Use 0 as chat identifier to exclude all files not belonging to any chat (e.g., profile photos).
    • returnDeletedFileStatistics

      public boolean returnDeletedFileStatistics
      Pass true if statistics about the files that were deleted must be returned instead of the whole storage usage statistics. Affects only returned statistics.
    • chatLimit

      public int chatLimit
      Same as in getStorageStatistics. Affects only returned statistics.
    • CONSTRUCTOR

      public static final int CONSTRUCTOR
      Identifier uniquely determining type of the object.
      See Also:
  • Constructor Details

    • OptimizeStorage

      public OptimizeStorage()
      Optimizes storage usage, i.e. deletes some files and returns new storage usage statistics. Secret thumbnails can't be deleted.

      Returns StorageStatistics

    • OptimizeStorage

      public OptimizeStorage(long size, int ttl, int count, int immunityDelay, TdApi.FileType[] fileTypes, long[] chatIds, long[] excludeChatIds, boolean returnDeletedFileStatistics, int chatLimit)
      Optimizes storage usage, i.e. deletes some files and returns new storage usage statistics. Secret thumbnails can't be deleted.

      Returns StorageStatistics

      Parameters:
      size - Limit on the total size of files after deletion, in bytes. Pass -1 to use the default limit.
      ttl - Limit on the time that has passed since the last time a file was accessed (or creation time for some filesystems). Pass -1 to use the default limit.
      count - Limit on the total number of files after deletion. Pass -1 to use the default limit.
      immunityDelay - The amount of time after the creation of a file during which it can't be deleted, in seconds. Pass -1 to use the default value.
      fileTypes - If non-empty, only files with the given types are considered. By default, all types except thumbnails, profile photos, stickers and wallpapers are deleted.
      chatIds - If non-empty, only files from the given chats are considered. Use 0 as chat identifier to delete files not belonging to any chat (e.g., profile photos).
      excludeChatIds - If non-empty, files from the given chats are excluded. Use 0 as chat identifier to exclude all files not belonging to any chat (e.g., profile photos).
      returnDeletedFileStatistics - Pass true if statistics about the files that were deleted must be returned instead of the whole storage usage statistics. Affects only returned statistics.
      chatLimit - Same as in getStorageStatistics. Affects only returned statistics.

      Returns StorageStatistics

    • OptimizeStorage

      public OptimizeStorage(DataInput input) throws IOException
      Optimizes storage usage, i.e. deletes some files and returns new storage usage statistics. Secret thumbnails can't be deleted.

      Returns StorageStatistics

      Parameters:
      input - Serialized input
      Throws:
      IOException - the deserialization failed
  • Method Details

    • getConstructor

      public int getConstructor()
      Description copied from class: TdApi.Object
      Returns an identifier uniquely determining type of the object.
      Specified by:
      getConstructor in class TdApi.Object
      Returns:
      this.CONSTRUCTOR
    • serialize

      public void serialize(DataOutput output) throws IOException
      Serialize the TDLib class
      Specified by:
      serialize in class TdApi.Object
      Parameters:
      output - output data stream
      Throws:
      IOException - the serialization failed
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object