TarUtil
public class TarUtil
extends Object
java.lang.Object |
↳ | com.android.tradefed.util.TarUtil |
כלי עזר לתפעל קובץ tar. זה עוטף את הקומפרס על מנת לספק תמיכה בזפת.
סיכום
שיטות ציבוריות |
---|
static void | extractAndLog ( ITestLogger listener, File targzFile, String baseName) עוזר לחלץ ולהתחבר לכתבים קובץ tar gz והתוכן שלו |
static File | extractTarGzipToTemp (File targzFile, String nameHint) Untar ו-ungzip קובץ tar.gz לספריית זמני. |
static File | gzip (File inputFile) פונקציית שירות ל-gzip (.gz) קובץ. |
static boolean | isGzip (File file) קבע אם קובץ הוא gzip. |
static File | unGzip (File inputFile, File outputDir) UnGZip a file: קובץ tar.gz יהפוך לקובץ tar. |
static | unTar (File inputFile, File outputDir) הסר קובץ tar לתוך ספרייה. |
static | unTar (File inputFile, File outputDir, fileNames) unTar (File inputFile, File outputDir, fileNames) הסר קובץ tar לתוך ספרייה. |
בנאים ציבוריים
TarUtil
public TarUtil ()
שיטות ציבוריות
extractAndLog
public static void extractAndLog (ITestLogger listener,
File targzFile,
String baseName)
עוזר לחלץ ולהתחבר לכתבים קובץ tar gz והתוכן שלו
פרמטרים |
---|
listener | ITestLogger : ה- ITestLogger היכן לרשום את הקבצים. |
targzFile | File : tar.gz ERROR(/File) שצריך את יומן התוכן שלו. |
baseName | String : שם הבסיס שמתחתיו יימצאו הקבצים. |
public static File extractTarGzipToTemp (File targzFile,
String nameHint)
Untar ו-ungzip קובץ tar.gz לספריית זמני.
פרמטרים |
---|
targzFile | File : קובץ tar.gz לחילוץ. |
nameHint | String : הקידומת של הספרייה הזמנית. |
החזרות |
---|
File | ספריית הזמנים. |
זורק |
---|
| FileNotFoundException |
| IOException |
gzip
public static File gzip (File inputFile)
פונקציית שירות ל-gzip (.gz) קובץ. הסיומת .gz תתווסף לשם הקובץ הבסיסי.
isGzip
public static boolean isGzip (File file)
קבע אם קובץ הוא gzip.
פרמטרים |
---|
file | File : הקובץ שיש לבדוק. |
החזרות |
---|
boolean | אם הקובץ הוא gzip. |
זורק |
---|
| אם לא ניתן היה לקרוא את הקובץ. |
unGzip
public static File unGzip (File inputFile,
File outputDir)
UnGZip a file: קובץ tar.gz יהפוך לקובץ tar.
פרמטרים |
---|
inputFile | File : ERROR(/File) ל-ungzip |
outputDir | File : הספרייה שבה לשים את הקובץ הלא מכווץ. |
זורק |
---|
| FileNotFoundException |
| IOException |
unTar
public static unTar (File inputFile,
File outputDir)
הסר קובץ tar לתוך ספרייה. קובץ tar.gz צריך להיות unGzip(File, File)
תחילה.
פרמטרים |
---|
inputFile | File : קובץ tar לחילוץ |
outputDir | File : הספרייה שבה לשים את הקבצים שחולצו. |
זורק |
---|
| FileNotFoundException |
| IOException |
unTar
public static unTar (File inputFile,
File outputDir,
fileNames)
הסר קובץ tar לתוך ספרייה. קובץ tar.gz צריך להיות unGzip(File, File)
תחילה.
פרמטרים |
---|
inputFile | File : קובץ tar לחילוץ |
outputDir | File : הספרייה שבה לשים את הקבצים שחולצו. |
fileNames | : הקבצים שיש לחלץ מה-tar. |
זורק |
---|
| FileNotFoundException |
| IOException |