Created
October 30, 2020 17:50
-
-
Save Kimeiga/b05a723e0ebc1f6f65117515f7b33ddc to your computer and use it in GitHub Desktop.
cs130_dis_2020-10-30
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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