Danielededo / SagradaFamilia

Software Engineering Project 2017/2018 @Polimi
Apache License 2.0
1 stars 0 forks source link

file missing #9

Closed ingconti closed 6 years ago

ingconti commented 6 years ago

running JAR we got:

"Timer configuration from configuration file timer.properties"

file: timer.properties is missing

Danielededo commented 6 years ago

We updated the file, please check if everything is ok. P.s. We also changed CONFIG.md

ingconti commented 6 years ago

I played anyway... seems good.. a bit tricky to understand click to select dice... Am I wrong? I have not visual feedback..

ingconti commented 6 years ago

another MINOR note.... You is NOT your turn, "passa turno" should ber grayed out/didsabled?

ingconti commented 6 years ago

anyway a good job! :)

ingconti commented 6 years ago

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"

SaraDeMonaco commented 6 years ago

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

ingconti commented 6 years ago

so "src/main/resources" is a path internal to JAR? I hope final user should not create such folder..

SaraDeMonaco commented 6 years ago

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.

ingconti commented 6 years ago

pls see on Piazza similar problems about paths, and after re-analyze your code.

ingconti commented 6 years ago

to sum up:

screen shot 2018-07-07 at 5 58 25 pm

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.

Danielededo commented 6 years ago

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 !!

ingconti commented 6 years ago

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