bacoAlunos
ENGSOFT2019
BlueGrey
calm
Elegant
Català-Valencià - Catalan
中文 - Chinese (Simplified)
中文 - Chinese (Traditional)
Česky - Czech
Dansk - Danish
Nederlands - Dutch
English - English
Suomi - Finnish
Français - French
Deutsch - German
עברית - Hebrew
हिंदी - Hindi
Magyar - Hungarian
Bahasa Indonesia - Indonesian
Italiano - Italian
日本語 - Japanese
한국어 - Korean
मराठी - Marathi
Norsk - Norwegian
Polski - Polish
Português - Portuguese
Português - Portuguese (Brazil)
Русский - Russian
Slovenčina - Slovak
Slovenščina - Slovenian
Español - Spanish
Svenska - Swedish
Türkçe - Turkish
Oëzbekcha - Uzbek
Subversion Repositories
bacoAlunos
(root)
/
branches
/
grupo10
/
impl
/
src
/
java
/
pt
/
estgp
/
estgweb
/
web
/
utils
/
JspInterfacesJsonGen.java
@ 1989
- Rev 1967
Rev
Rev 1945
|
Blame
|
Compare with Previous
|
Last modification
|
View Log
|
RSS feed
package
pt.estgp.estgweb.web.utils
;
import
org.json.JSONArray
;
import
java.io.File
;
import
java.io.FileWriter
;
import
java.io.IOException
;
/**
* Created by jorgemachado on 14/06/17.
*/
public
class
JspInterfacesJsonGen
{
public
static
final
1.
5
.0/docs/api/java/lang/String.html">
String
JSON_FILE_JSPS =
"/pt/estgp/estgweb/web/jsps.json"
;
public
static
void
main
(
1.
5
.0/docs/api/java/lang/String.html">
String
[
]
args
)
throws
1.
5
.0/docs/api/java/io/IOException.html">
IOException
{
1.
5
.0/docs/api/java/lang/String.html">
String
classesDir = args
[
0
]
;
1.
5
.0/docs/api/java/lang/String.html">
String
jsonOutput = classesDir + JSON_FILE_JSPS
;
1.
5
.0/docs/api/java/lang/String.html">
String
srcWebRoot = args
[
1
]
;
1.
5
.0/docs/api/java/lang/String.html">
String
[
]
jspsDirs = args
[
2
]
.
split
(
";"
)
;
JSONArray jspsArray =
new
JSONArray
(
)
;
for
(
1.
5
.0/docs/api/java/lang/String.html">
String
jspDir: jspsDirs
)
{
1.
5
.0/docs/api/java/lang/System.html">
System
.
out
.
println
(
jspDir
)
;
listTree
(
jspsArray,
new
1.
5
.0/docs/api/java/io/File.html">
File
(
srcWebRoot + jspDir
)
,
""
)
;
}
1.
5
.0/docs/api/java/io/FileWriter.html">
FileWriter
fw =
new
1.
5
.0/docs/api/java/io/FileWriter.html">
FileWriter
(
jsonOutput
)
;
fw.
write
(
jspsArray.
toString
(
)
)
;
fw.
flush
(
)
;
fw.
close
(
)
;
}
private
static
void
listTree
(
JSONArray output,
1.
5
.0/docs/api/java/io/File.html">
File
f,
1.
5
.0/docs/api/java/lang/String.html">
String
jspAppPath
)
{
if
(
f.
isDirectory
(
)
)
{
for
(
1.
5
.0/docs/api/java/io/File.html">
File
child: f.
listFiles
(
)
)
{
listTree
(
output,child,jspAppPath +
"/"
+ f.
getName
(
)
)
;
}
}
else
if
(
f.
getName
(
)
.
endsWith
(
".jsp"
)
)
{
output.
put
(
jspAppPath +
"/"
+ f.
getName
(
)
)
;
}
}
}