Skip to content

Commit b35b589

Browse files
author
quaa
committed
Made the client a little less annoying when syncing and added screenshots
1 parent 1f774d3 commit b35b589

File tree

6 files changed

+11
-2
lines changed

6 files changed

+11
-2
lines changed

executable/jfs.jar

97 Bytes
Binary file not shown.
36.9 KB
Loading

screenShots/mainClient2Server.png

48.6 KB
Loading

screenShots/server2client-S.png

11.4 KB
Loading

screenShots/server2client.png

51 KB
Loading

src/net/quaa/jfs/Client.java

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ public class Client {
2121
private static Socket sock;
2222
private static ObjectInputStream ois;
2323
private static ObjectOutputStream oos;
24+
private static int fileCount = 0;
2425

2526
public Client(String dirName, String fullDirName, String serverIP, int port) {
2627
Client.dirName = dirName;
@@ -80,7 +81,11 @@ public void runClient() throws Exception {
8081

8182
// Process all files and directories under dir
8283
private static void visitAllDirsAndFiles(File dir) throws Exception{
83-
System.out.print(".");
84+
if (fileCount % 20 == 0) {
85+
System.out.print(".");
86+
fileCount = 0;
87+
}
88+
fileCount++;
8489
Vector<String> vec = new Vector<String>();
8590
vec.add(dir.getName());
8691
vec.add(dir.getAbsolutePath().substring((dir.getAbsolutePath().indexOf(fullDirName) + fullDirName.length())));
@@ -164,7 +169,11 @@ private static void updateFromServer() throws Exception {
164169
Boolean isDone = false;
165170
Boolean nAll = false;
166171
while(!isDone) {
167-
System.out.print(".");
172+
if (fileCount % 20 == 0) {
173+
System.out.print(".");
174+
fileCount = 0;
175+
}
176+
fileCount++;
168177
String path = (String) ois.readObject();
169178

170179
if(path.equals(DONE)) {

0 commit comments

Comments
 (0)