Closed ingconti closed 6 years ago
We updated the file, please check if everything is ok. P.s. We also changed CONFIG.md
I played anyway... seems good.. a bit tricky to understand click to select dice... Am I wrong? I have not visual feedback..
another MINOR note.... You is NOT your turn, "passa turno" should ber grayed out/didsabled?
anyway a good job! :)
a question: I see the file in "SagradaFamilia/Deliverables/src/main/resources/timer.properties"
what is the correct place for it?
I read You wrote:
"Timer configuration from configuration file timer.properties that is in src/main/resources"
We've added the file into Server directory, which is now in Deliverables, alongside the jar, now the path src/main/resources should be correct
so "src/main/resources" is a path internal to JAR? I hope final user should not create such folder..
I'm sorry, we don't understand how to solve this problem, where should timer.properties (or other resources) be put then? We included timer.properties inside the jar.
pls see on Piazza similar problems about paths, and after re-analyze your code.
to sum up:
So the right approach ca be: 1) write a SMALL app
2) try to read your text file (for an example of code: https://www.tutorialspoint.com/java/io/file_exists.htm)
3) use the f. to test EXISTENCE and PRINT informative details && diags. 4) if You run inside IntelliJ, app will use a different folder 5) use a "Best effort" search in a known directory AND print if you can read, if NO, search for example one level up... 6) print always current working path, to detect where you are working
NOTE: perform in intellyJ AND directly from JAR
ps I am preparing a small app to help you.
We have choosen a easier way, timers are now parameters you have to input from command line. Thanks a lot for the time you spent on this !!
ok. and you have defaults? how to change at runtime?
Anyway this very simple pice of code will show you what you need:
public class Main {
public static void main(String[] args) {
String workingDir = System.getProperty("user.dir");
System.out.println("Current working directory : " + workingDir);
}
}
PS verify that: 1) you can parametrize from CMD line 2) verify you can parametrize ALL info (port, ip, etc..) 3) have a set of defaults. 4) if You need all values, display a message like:
usage: ... -p -ip ...
example: from terminal on Unix if you type: ping
you got:
usage: ping [-AaDdfnoQqRrv] [-c count] [-G sweepmaxsize] [-g sweepminsize] [-h sweepincrsize] [-i wait] [-l preload] [-M mask | time] [-m ttl] [-p pattern] [-S src_addr] [-s packetsize] [-t timeout][-W waittime] [-z tos] host
running JAR we got:
"Timer configuration from configuration file timer.properties"
file: timer.properties is missing