mirror of
https://github.com/gnh1201/welsonjs.git
synced 2025-05-14 05:31:03 +00:00
Create archive.js
This commit is contained in:
parent
fe2466b49a
commit
4370f40886
27
lib/archive.js
Normal file
27
lib/archive.js
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
// archive.js
|
||||||
|
|
||||||
|
var ArchiveObject = function() {
|
||||||
|
this.engine = "HOW_TO_COMPRESS_AND_DECOMPRES_A_FILE
|
||||||
|
|
||||||
|
this.create = function(engine) {
|
||||||
|
this.engine = engine;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.extractTo = function(targetDirectory) {
|
||||||
|
if (this.engine == "METHOD_1") {
|
||||||
|
// how to extract a file with METHOD_1
|
||||||
|
} else (this.engine == "METHOD_2") {
|
||||||
|
// how to extract a file with METHOD_2
|
||||||
|
} // ...
|
||||||
|
}
|
||||||
|
|
||||||
|
this.compressDirectory = function(sourceDirectory) {
|
||||||
|
if (this.engine == "METHOD_1") {
|
||||||
|
// how to compress a file with METHOD_1
|
||||||
|
} else (this.engine == "METHOD_2") {
|
||||||
|
// how to compress a file with METHOD_2
|
||||||
|
} // ...
|
||||||
|
}
|
||||||
|
|
||||||
|
// A good practice is lib/http.js
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user