自 2025 年 3 月 27 日起,我们建议您使用 android-latest-release
而非 aosp-main
构建 AOSP 并为其做出贡献。如需了解详情,请参阅 AOSP 的变更。
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
ICompressionStrategy
public
interface
ICompressionStrategy
com.android.tradefed.util.ICompressionStrategy
|
表示可在运行时选择的压缩算法的接口。
摘要
公共方法
压缩
public abstract File compress (File source)
压缩 source
文件(或文件夹),并返回生成的归档文件。
本页面上的内容和代码示例受内容许可部分所述许可的限制。Java 和 OpenJDK 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-27。
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["没有我需要的信息","missingTheInformationINeed","thumb-down"],["太复杂/步骤太多","tooComplicatedTooManySteps","thumb-down"],["内容需要更新","outOfDate","thumb-down"],["翻译问题","translationIssue","thumb-down"],["示例/代码问题","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-07-27。"],[],[],null,["# ICompressionStrategy\n====================\n\n\n`\npublic\n\n\ninterface\nICompressionStrategy\n`\n\n\n`\n\n\n`\n\n|------------------------------------------------|\n| com.android.tradefed.util.ICompressionStrategy |\n\n|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Known indirect subclasses [ZipCompressionStrategy](../../../../../../reference/tradefed/com/android/tradefed/util/ZipCompressionStrategy.html) |----------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------| | [ZipCompressionStrategy](../../../../../../reference/tradefed/com/android/tradefed/util/ZipCompressionStrategy.html) | An [ICompressionStrategy](../../../../../../reference/tradefed/com/android/tradefed/util/ICompressionStrategy.html) for creating zip archives. | |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nAn interface representing a compression algorithm that can be selected at runtime.\n\nSummary\n-------\n\n| ### Public methods ||\n|--------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` abstract File` | ` `[compress](../../../../../../reference/tradefed/com/android/tradefed/util/ICompressionStrategy.html#compress(File))`(File source) ` Compresses the `source` file (or folder) and returns the resulting archive. |\n| ` abstract `[LogDataType](../../../../../../reference/tradefed/com/android/tradefed/result/LogDataType.html) | ` `[getLogDataType](../../../../../../reference/tradefed/com/android/tradefed/util/ICompressionStrategy.html#getLogDataType())`() ` Returns the [LogDataType](../../../../../../reference/tradefed/com/android/tradefed/result/LogDataType.html) of the archive format used by this strategy. |\n\nPublic methods\n--------------\n\n### compress\n\n```\npublic abstract File compress (File source)\n```\n\nCompresses the `source` file (or folder) and returns the resulting archive.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|----------|--------------------------------------------------|\n| `source` | `File`: The file or directory to compress \u003cbr /\u003e |\n\n| Returns ||\n|--------|-------------------------------|\n| `File` | The compressed archive \u003cbr /\u003e |\n\n| Throws ||\n|---|-----------------------------------------|\n| | If the operation could not be completed |\n\n### getLogDataType\n\n```\npublic abstract LogDataType getLogDataType ()\n```\n\nReturns the [LogDataType](../../../../../../reference/tradefed/com/android/tradefed/result/LogDataType.html) of the archive format used by this strategy.\n\n\u003cbr /\u003e\n\n| Returns ||\n|--------------------------------------------------------------------------------------------------|--------|\n| [LogDataType](../../../../../../reference/tradefed/com/android/tradefed/result/LogDataType.html) | \u003cbr /\u003e |"]]