自 2025 年 3 月 27 日起,我們建議您使用 android-latest-release
而非 aosp-main
建構及貢獻 AOSP。詳情請參閱「Android 開放原始碼計畫變更」。
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
FakeTestsZipFolder
public
class
FakeTestsZipFolder
extends Object
java.lang.Object
|
↳ |
com.android.tradefed.util.FakeTestsZipFolder
|
測試固定項目,可根據內容清單建立偽裝的解壓縮測試資料夾。系統會根據提供給建構函式的檔案名稱或資料夾名稱清單,設定資料夾結構。在不再需要資料夾時,應呼叫 FakeTestsZipFolder.cleanUp()
。
摘要
公用建構函式
FakeTestsZipFolder
public FakeTestsZipFolder ( items)
建立由空白檔案備份的假解壓測試資料夾
參數 |
items |
:要納入假的解壓縮資料夾的項目清單。此對應項目的鍵應為項目的相對路徑,項目的值應指出項目應由空白檔案或資料夾備份 |
公用方法
cleanUp
public void cleanUp ()
刪除整個偽造的解壓縮測試資料夾
createItems
public boolean createItems ()
根據項目的資訊清單建立假的解壓縮測試資料夾
傳回 |
boolean |
如果無法建立任何項目,則為 false |
getBasePath
public File getBasePath ()
傳回假的未解壓縮資料夾的基礎。這會取代根資料夾,其中會展開實際的測試 ZIP 檔案
受保護的方法
getDataFolder
protected File getDataFolder ()
這個頁面中的內容和程式碼範例均受《內容授權》中的授權所規範。Java 與 OpenJDK 是 Oracle 和/或其關係企業的商標或註冊商標。
上次更新時間: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"]],["上次更新時間:2025-07-27 (世界標準時間)。"],[],[],null,["# FakeTestsZipFolder\n==================\n\n\n`\npublic\n\n\nclass\nFakeTestsZipFolder\n`\n\n\n`\n\nextends Object\n\n\n`\n\n`\n\n\n`\n\n|---|----------------------------------------------|\n| java.lang.Object ||\n| ↳ | com.android.tradefed.util.FakeTestsZipFolder |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nA testing fixture that creates a fake unzipped tests folder based on a list of content.\n\nThe folder structure is configured based on a list of file names or folder names, as provided\nto the constructor. [FakeTestsZipFolder.cleanUp()](../../../../../../reference/tradefed/com/android/tradefed/util/FakeTestsZipFolder.html#cleanUp()) should be called after the folder is\nno longer needed.\n\nSummary\n-------\n\n| ### Public constructors ||\n|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|\n| ` `[FakeTestsZipFolder](../../../../../../reference/tradefed/com/android/tradefed/util/FakeTestsZipFolder.html#FakeTestsZipFolder(\u003cany\u003e))`(` items) Create a fake unzipped tests folder backed by empty files |\n\n| ### Public methods ||\n|------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` void` | ` `[cleanUp](../../../../../../reference/tradefed/com/android/tradefed/util/FakeTestsZipFolder.html#cleanUp())`() ` Delete the entire fake unzipped test folder |\n| ` boolean` | ` `[createItems](../../../../../../reference/tradefed/com/android/tradefed/util/FakeTestsZipFolder.html#createItems())`() ` Create fake unzipped tests folder as indicated by the manifest of items |\n| ` File` | ` `[getBasePath](../../../../../../reference/tradefed/com/android/tradefed/util/FakeTestsZipFolder.html#getBasePath())`() ` Returns the base of the fake unzipped folder This would be a replacement of root folder where a real tests zip is expanded |\n\n| ### Protected methods ||\n|---------|---------------------------------------------------------------------------------------------------------------------------------|\n| ` File` | ` `[getDataFolder](../../../../../../reference/tradefed/com/android/tradefed/util/FakeTestsZipFolder.html#getDataFolder())`() ` |\n\nPublic constructors\n-------------------\n\n### FakeTestsZipFolder\n\n```\npublic FakeTestsZipFolder ( items)\n```\n\nCreate a fake unzipped tests folder backed by empty files\n\n\u003cbr /\u003e\n\n| Parameters ||\n|---------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `items` | : list of items to include in the fake unzipped folder. key of the map shall be the relative path of the item, value of the entry shall indicate if the entry should be backed by an empty file or a folder \u003cbr /\u003e |\n\nPublic methods\n--------------\n\n### cleanUp\n\n```\npublic void cleanUp ()\n```\n\nDelete the entire fake unzipped test folder\n\n\u003cbr /\u003e\n\n### createItems\n\n```\npublic boolean createItems ()\n```\n\nCreate fake unzipped tests folder as indicated by the manifest of items\n\n\u003cbr /\u003e\n\n| Returns ||\n|-----------|-------------------------------------------|\n| `boolean` | false if failed to create any item \u003cbr /\u003e |\n\n| Throws ||\n|---|-------------|\n| | IOException |\n\n### getBasePath\n\n```\npublic File getBasePath ()\n```\n\nReturns the base of the fake unzipped folder This would be a replacement\nof root folder where a real tests zip is expanded\n\n\u003cbr /\u003e\n\n| Returns ||\n|--------|--------|\n| `File` | \u003cbr /\u003e |\n\nProtected methods\n-----------------\n\n### getDataFolder\n\n```\nprotected File getDataFolder ()\n```\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ||\n|--------|--------|\n| `File` | \u003cbr /\u003e |"]]