From c71888baffe2a523bdbf6cd258a604ab10aaa006 Mon Sep 17 00:00:00 2001 From: Pankaj Nimgade Date: Thu, 24 May 2018 22:57:41 -0500 Subject: [PATCH] added exercise 1.21-Interacting-With-The-File-System code and test images --- .../build.gradle | 101 ++++++++++++++++++ .../images/_test_directory.txt | 1 + .../images/first.bmp | 0 .../images/second.png | 0 .../images/third.jpg | 0 5 files changed, 102 insertions(+) create mode 100644 1.21-Interacting With The File System/build.gradle create mode 100644 1.21-Interacting With The File System/images/_test_directory.txt create mode 100644 1.21-Interacting With The File System/images/first.bmp create mode 100644 1.21-Interacting With The File System/images/second.png create mode 100644 1.21-Interacting With The File System/images/third.jpg diff --git a/1.21-Interacting With The File System/build.gradle b/1.21-Interacting With The File System/build.gradle new file mode 100644 index 000000000..0670d4613 --- /dev/null +++ b/1.21-Interacting With The File System/build.gradle @@ -0,0 +1,101 @@ +/** +Keep a 'images' directory with images of diffrent types and test the code +*/ + +task copyImages(type: Copy){ + + from 'images' + into 'build' +} + +task copyJpegs(type: Copy){ + + from 'images' + include '*.jpg' + into 'build' +} + +task copyPnges(type: Copy){ + + from 'images' + include '*.png' + into 'build' +} + +task copyImageFolders(type: Copy){ + + from('images'){ + include '*.jpg' + into 'jpeg' + } + + from('images'){ + include '*.png' + into 'png' + } + + into 'build' + +} + + +task zipImages(type: Zip){ + + baseName = 'images' + destinationDir = file('build') + from 'images' + +} + + + +task zipImagesFolders(type: Zip){ + + baseName = 'images' + destinationDir = file('build') + + from('images') { + include '*.jpg' + into 'jpeg' + } + + from('images'){ + include '*.png' + into 'png' + } + +} + +task deleteBuild(type: Delete){ + + delete 'build' + +} + + +task unzip(type: Copy){ + + dependsOn 'deleteBuild' + + def zipInput = file('images.zip') + from zipTree(zipInput) + into 'build' +} + + + + + + + + + + + + + + + + + + diff --git a/1.21-Interacting With The File System/images/_test_directory.txt b/1.21-Interacting With The File System/images/_test_directory.txt new file mode 100644 index 000000000..0c7a75b4c --- /dev/null +++ b/1.21-Interacting With The File System/images/_test_directory.txt @@ -0,0 +1 @@ +Put images with *.png, *.jpeg or *.gif in this directory and run the diffrent tasks to check the code output. \ No newline at end of file diff --git a/1.21-Interacting With The File System/images/first.bmp b/1.21-Interacting With The File System/images/first.bmp new file mode 100644 index 000000000..e69de29bb diff --git a/1.21-Interacting With The File System/images/second.png b/1.21-Interacting With The File System/images/second.png new file mode 100644 index 000000000..e69de29bb diff --git a/1.21-Interacting With The File System/images/third.jpg b/1.21-Interacting With The File System/images/third.jpg new file mode 100644 index 000000000..e69de29bb