Skip to content

Instantly share code, notes, and snippets.

@Kimeiga
Created October 30, 2020 17:50
Show Gist options
  • Save Kimeiga/b05a723e0ebc1f6f65117515f7b33ddc to your computer and use it in GitHub Desktop.
Save Kimeiga/b05a723e0ebc1f6f65117515f7b33ddc to your computer and use it in GitHub Desktop.
cs130_dis_2020-10-30
class Dropbox {
public void uploadFiles(files, credentials) {
UserAuth userAuth = new UserAuth();
validity = userAuth.isValid(credentials);
if (validity) {
for file in files {
Filesystem filesystem = new Filesystem();
cached = filesystem.uploadFile(file);
logCacheInfo(cached);
}
}
return validity;
}
}
class UserAuth {
public bool isValid() {
return validity;
}
}
class Filesystem {
public bool uploadFile() {
Cache cache = new Cache();
isCached = cache.isCached(file);
if (!isCached) {
saveFile(file);
}
return isCached;
}
}
class Cache {
public bool isCached(file) {
return cached;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment