Changes
Page history
Update End of Term Assignment
authored
Jul 04, 2021
by
Zorenböhmer Christina
Show whitespace changes
Inline
Side-by-side
End-of-Term-Assignment.md
View page @
a3436965
...
...
@@ -255,9 +255,6 @@ public class wms_GetMap {
</details>
When this method is called from the main class, the user will be kept updated and will see the following on the console:
<details><summary>
See Console Output
</summary>
```
...
...
@@ -372,8 +369,6 @@ public class wms_ImageToKML {
</details>
When this method is called from the main class, the user will be kept updated and will see the following on the console:
<details><summary>
See Console Output
</summary>
```
...
...
@@ -393,7 +388,52 @@ Although this step was not included in the assignment instructions, we decided i
> - access and download the .csv file from a web-URL
The user is informed of this process when the method is called from the main class:
<details><summary>
See the Code for the "tweets_download.java" Class
</summary>
```
java
package
Test2
;
import
java.io.File
;
import
java.io.IOException
;
import
java.net.MalformedURLException
;
import
java.net.URL
;
import
org.apache.commons.io.FileUtils
;
public
class
tweets_download
{
public
static
void
saveFileFromUrlWithCommonsIO
(
String
fileName
,
String
fileUrl
)
throws
MalformedURLException
,
IOException
{
FileUtils
.
copyURLToFile
(
new
URL
(
fileUrl
),
new
File
(
fileName
));
}
public
static
void
downloadCSV
()
{
String
twitter_url
=
execute_programme
.
twitter_url
;
String
twitter_csv
=
execute_programme
.
twitter_csv
;
System
.
out
.
println
(
"Downloading online tweets.csv and storing locally ... "
);
try
{
saveFileFromUrlWithCommonsIO
(
twitter_csv
,
twitter_url
);
}
catch
(
MalformedURLException
e
)
{
e
.
printStackTrace
();
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
System
.
out
.
println
(
"CSV file downloaded and stored at :"
+
twitter_csv
);
}
}
```
</details>
<details><summary>
See Console Output
</summary>
...
...
...
...