From 8993702f69a281d889cbf636af7e1fc5844358ba Mon Sep 17 00:00:00 2001 From: Winston Li Date: Sun, 22 Feb 2015 22:49:02 +0000 Subject: [PATCH] Initial large refactor. --- services/git-bridge/pom.xml | 2 +- .../application/AttsResourceHandler.java | 8 +-- .../ac/ic/wlgitbridge/application/Config.java | 2 +- .../ic/wlgitbridge/application/SSLConfig.java | 28 ----------- .../SnapshotPushPostbackContents.java | 20 ++++---- .../SnapshotPushPostbackHandler.java | 12 ++--- .../application/WLGitBridgeApplication.java | 2 +- .../application/WLGitBridgeServer.java | 15 +++--- .../BridgeAPI.java} | 36 ++++++------- .../bridge/CandidateSnapshotCallback.java | 12 ----- .../ic/wlgitbridge/bridge/RawDirectory.java | 11 ---- .../wlgitbridge/bridge/RepositorySource.java | 16 ------ .../wlgitbridge/bridge/WLBridgedProject.java | 23 ++++----- .../bridge/WritableRepositoryContents.java | 23 --------- .../bridge/WriteLatexDataSource.java | 33 ------------ .../CandidateSnapshot.java | 6 +-- .../{writelatex => data}/LockAllWaiter.java | 2 +- .../{writelatex => data}/ProjectLock.java | 2 +- .../{writelatex => data}/ServletFile.java | 4 +- .../{writelatex => data}/ShutdownHook.java | 2 +- .../{writelatex => data}/SnapshotFetcher.java | 20 ++++---- .../SnapshotRepositoryBuilder.java | 20 ++++---- .../filestore/GitDirectoryContents.java | 14 ++---- .../data/filestore/RawDirectory.java | 20 ++++++++ .../{bridge => data/filestore}/RawFile.java | 2 +- .../filestore/RepositoryFile.java | 4 +- .../{writelatex => data}/model/DataStore.java | 24 ++++----- .../model/ResourceFetcher.java | 10 ++-- .../{writelatex => data}/model/Snapshot.java | 12 ++--- .../model/URLIndexStore.java | 2 +- .../model/db/PersistentStore.java | 6 +-- .../model/db/sql/SQLQuery.java | 2 +- .../model/db/sql/SQLUpdate.java | 2 +- .../model/db/sql/SQLiteWLDatabase.java | 20 ++++---- .../GetLatestVersionForProjectSQLQuery.java | 4 +- .../query/GetPathForURLInProjectSQLQuery.java | 4 +- .../db/sql/query/GetProjectNamesSQLQuery.java | 4 +- .../create/CreateIndexURLIndexStore.java | 4 +- .../create/CreateProjectsTableSQLUpdate.java | 4 +- .../create/CreateURLIndexStoreSQLUpdate.java | 4 +- .../DeleteFilesForProjectSQLUpdate.java | 4 +- .../update/insert/AddURLIndexSQLUpdate.java | 4 +- .../update/insert/SetProjectSQLUpdate.java | 4 +- .../git/handler/WLReceivePackFactory.java | 10 ++-- .../git/handler/WLRepositoryResolver.java | 9 ++-- .../git/handler/hook/WriteLatexPutHook.java | 20 ++++---- .../hook/exception/ForcedPushException.java | 2 +- .../hook/exception/WrongBranchException.java | 2 +- .../wlgitbridge/git/servlet/WLGitServlet.java | 10 ++-- .../wlgitbridge/git/util/FileDirectory.java | 24 --------- .../git/util/RepositoryObjectTreeWalker.java | 8 +-- .../request => snapshot}/base/HTTPMethod.java | 2 +- .../request => snapshot}/base/JSONSource.java | 2 +- .../request => snapshot}/base/Request.java | 4 +- .../api/request => snapshot}/base/Result.java | 2 +- .../base/SnapshotAPIRequest.java | 2 +- .../exception/FailedConnectionException.java | 2 +- .../getdoc/SnapshotGetDocRequest.java | 8 +-- .../getdoc/SnapshotGetDocResult.java | 14 +++--- .../exception/InvalidProjectException.java | 4 +- .../exception/ProtectedProjectException.java | 4 +- .../getforversion/SnapshotAttachment.java | 4 +- .../getforversion/SnapshotData.java | 4 +- .../getforversion/SnapshotFile.java | 6 +-- .../SnapshotGetForVersionRequest.java | 8 +-- .../SnapshotGetForVersionResult.java | 6 +-- .../SnapshotGetSavedVersRequest.java | 8 +-- .../SnapshotGetSavedVersResult.java | 8 +-- .../getsavedvers/SnapshotInfo.java | 2 +- .../getsavedvers/WLUser.java | 2 +- .../push/PostbackContents.java | 10 ++-- .../push/PostbackManager.java | 8 +-- .../push/SnapshotPushRequest.java | 10 ++-- .../push/SnapshotPushRequestResult.java | 8 +-- .../exception/InternalErrorException.java | 2 +- .../push/exception/InvalidFilesException.java | 2 +- .../InvalidPostbackKeyException.java | 2 +- .../exception/InvalidProjectException.java | 2 +- .../push/exception/OutOfDateException.java | 2 +- .../exception/PostbackTimeoutException.java | 2 +- .../SevereSnapshotPostException.java | 2 +- .../push/exception/SnapshotPostException.java | 4 +- .../SnapshotPostExceptionBuilder.java | 5 +- .../exception/UnexpectedErrorException.java | 2 +- .../UnexpectedPostbackException.java | 2 +- .../{test => snapshot/servermock}/Main.java | 6 +-- .../exception/InvalidAPICallException.java | 2 +- .../response/SnapshotResponse.java | 2 +- .../response/SnapshotResponseBuilder.java | 14 +++--- .../getdoc/SnapshotGetDocResponse.java | 6 +-- .../getforver/SnapshotGetForVerResponse.java | 6 +-- .../SnapshotGetSavedVersResponse.java | 6 +-- .../response/push/SnapshotPushResponse.java | 8 +-- .../push/data/SnapshotPushResult.java | 2 +- .../data/SnapshotPushResultOutOfDate.java | 2 +- .../push/data/SnapshotPushResultSuccess.java | 2 +- .../postback/SnapshotPostbackRequest.java | 2 +- .../SnapshotPostbackRequestError.java | 2 +- .../SnapshotPostbackRequestInvalidFiles.java | 4 +- ...SnapshotPostbackRequestInvalidProject.java | 2 +- .../SnapshotPostbackRequestOutOfDate.java | 2 +- .../SnapshotPostbackRequestSuccess.java | 2 +- .../invalidfile/InvalidFileError.java | 2 +- .../invalidfile/InvalidFileErrorDefault.java | 2 +- .../InvalidFileErrorDisallowed.java | 2 +- .../invalidfile/InvalidFileErrorUnclean.java | 2 +- .../server/MockSnapshotRequestHandler.java | 8 +-- .../server/MockSnapshotServer.java | 6 +-- .../servermock}/server/PostbackThread.java | 2 +- .../servermock}/state/SnapshotAPIState.java | 50 +++++++++---------- .../state/SnapshotAPIStateBuilder.java | 26 +++++----- .../state/SnapshotAPIStateManager.java | 2 +- .../servermock}/util/FileUtil.java | 2 +- .../java/uk/ac/ic/wlgitbridge/util/Util.java | 3 -- .../model/db/PersistentStoreUpdater.java | 10 ---- .../WLGitBridgeIntegrationTest.java | 10 ++-- .../DeleteFilesForProjectSQLUpdateTest.java | 2 +- .../servermock}/util/FileUtilTest.java | 30 +++++------ .../neq1/file.txt | 0 .../neq1/neq1.txt | 0 .../neq2/file.txt | 0 .../neq2/neq2.txt | 0 .../neq1/neq1/file.txt | 0 .../neq2/neq2/file.txt | 0 .../neq1/file.txt | 0 .../neq2/file.txt | 0 .../neq1/dir/file.txt | 0 .../neq1/file.txt | 0 .../neq2/dir/file.txt | 0 .../neq2/file.txt | 0 .../eq1/dir/file.txt | 0 .../eq1/file.txt | 0 .../eq2/dir/file.txt | 0 .../eq2/file.txt | 0 .../eq1/file.txt | 0 .../eq2/file.txt | 0 .../eq1/dir/file.txt | 0 .../eq1/file.txt | 0 .../eq2/dir/file.txt | 0 .../eq2/file.txt | 0 .../returnsFalseWhenCommitsAreDifferent/neq1 | 1 - .../returnsFalseWhenCommitsAreDifferent/neq2 | 1 - .../returnsTrueWhenCommitsAreTheSame/eq1 | 1 - .../returnsTrueWhenCommitsAreTheSame/eq2 | 1 - 144 files changed, 377 insertions(+), 549 deletions(-) delete mode 100644 services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/application/SSLConfig.java rename services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/{writelatex/WriteLatexAPI.java => bridge/BridgeAPI.java} (80%) delete mode 100644 services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/bridge/CandidateSnapshotCallback.java delete mode 100644 services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/bridge/RawDirectory.java delete mode 100644 services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/bridge/RepositorySource.java delete mode 100644 services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/bridge/WritableRepositoryContents.java delete mode 100644 services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/bridge/WriteLatexDataSource.java rename services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/{writelatex => data}/CandidateSnapshot.java (96%) rename services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/{writelatex => data}/LockAllWaiter.java (75%) rename services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/{writelatex => data}/ProjectLock.java (97%) rename services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/{writelatex => data}/ServletFile.java (87%) rename services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/{writelatex => data}/ShutdownHook.java (94%) rename services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/{writelatex => data}/SnapshotFetcher.java (79%) rename services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/{writelatex => data}/SnapshotRepositoryBuilder.java (61%) rename services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/{writelatex => data}/filestore/GitDirectoryContents.java (78%) create mode 100644 services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/data/filestore/RawDirectory.java rename services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/{bridge => data/filestore}/RawFile.java (95%) rename services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/{writelatex => data}/filestore/RepositoryFile.java (86%) rename services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/{writelatex => data}/model/DataStore.java (84%) rename services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/{writelatex => data}/model/ResourceFetcher.java (89%) rename services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/{writelatex => data}/model/Snapshot.java (81%) rename services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/{writelatex => data}/model/URLIndexStore.java (83%) rename services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/{writelatex => data}/model/db/PersistentStore.java (91%) rename services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/{writelatex => data}/model/db/sql/SQLQuery.java (80%) rename services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/{writelatex => data}/model/db/sql/SQLUpdate.java (82%) rename services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/{writelatex => data}/model/db/sql/SQLiteWLDatabase.java (77%) rename services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/{writelatex => data}/model/db/sql/query/GetLatestVersionForProjectSQLQuery.java (89%) rename services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/{writelatex => data}/model/db/sql/query/GetPathForURLInProjectSQLQuery.java (90%) rename services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/{writelatex => data}/model/db/sql/query/GetProjectNamesSQLQuery.java (87%) rename services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/{writelatex => data}/model/db/sql/update/create/CreateIndexURLIndexStore.java (81%) rename services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/{writelatex => data}/model/db/sql/update/create/CreateProjectsTableSQLUpdate.java (83%) rename services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/{writelatex => data}/model/db/sql/update/create/CreateURLIndexStoreSQLUpdate.java (87%) rename services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/{writelatex => data}/model/db/sql/update/delete/DeleteFilesForProjectSQLUpdate.java (90%) rename services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/{writelatex => data}/model/db/sql/update/insert/AddURLIndexSQLUpdate.java (87%) rename services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/{writelatex => data}/model/db/sql/update/insert/SetProjectSQLUpdate.java (85%) delete mode 100644 services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/git/util/FileDirectory.java rename services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/{writelatex/api/request => snapshot}/base/HTTPMethod.java (61%) rename services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/{writelatex/api/request => snapshot}/base/JSONSource.java (74%) rename services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/{writelatex/api/request => snapshot}/base/Request.java (94%) rename services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/{writelatex/api/request => snapshot}/base/Result.java (91%) rename services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/{writelatex/api/request => snapshot}/base/SnapshotAPIRequest.java (94%) rename services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/{writelatex/api/request => snapshot}/exception/FailedConnectionException.java (85%) rename services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/{writelatex/api/request => snapshot}/getdoc/SnapshotGetDocRequest.java (66%) rename services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/{writelatex/api/request => snapshot}/getdoc/SnapshotGetDocResult.java (85%) rename services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/{writelatex/api/request => snapshot}/getdoc/exception/InvalidProjectException.java (85%) rename services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/{writelatex/api/request => snapshot}/getdoc/exception/ProtectedProjectException.java (77%) rename services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/{writelatex/api/request => snapshot}/getforversion/SnapshotAttachment.java (88%) rename services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/{writelatex/api/request => snapshot}/getforversion/SnapshotData.java (93%) rename services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/{writelatex/api/request => snapshot}/getforversion/SnapshotFile.java (87%) rename services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/{writelatex/api/request => snapshot}/getforversion/SnapshotGetForVersionRequest.java (72%) rename services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/{writelatex/api/request => snapshot}/getforversion/SnapshotGetForVersionResult.java (78%) rename services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/{writelatex/api/request => snapshot}/getsavedvers/SnapshotGetSavedVersRequest.java (67%) rename services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/{writelatex/api/request => snapshot}/getsavedvers/SnapshotGetSavedVersResult.java (85%) rename services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/{writelatex/api/request => snapshot}/getsavedvers/SnapshotInfo.java (95%) rename services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/{writelatex/api/request => snapshot}/getsavedvers/WLUser.java (88%) rename services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/{writelatex/api/request => snapshot}/push/PostbackContents.java (83%) rename services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/{writelatex/api/request => snapshot}/push/PostbackManager.java (86%) rename services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/{writelatex/api/request => snapshot}/push/SnapshotPushRequest.java (74%) rename services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/{writelatex/api/request => snapshot}/push/SnapshotPushRequestResult.java (76%) rename services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/{writelatex/api/request => snapshot}/push/exception/InternalErrorException.java (90%) rename services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/{writelatex/api/request => snapshot}/push/exception/InvalidFilesException.java (96%) rename services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/{writelatex/api/request => snapshot}/push/exception/InvalidPostbackKeyException.java (61%) rename services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/{writelatex/api/request => snapshot}/push/exception/InvalidProjectException.java (92%) rename services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/{writelatex/api/request => snapshot}/push/exception/OutOfDateException.java (90%) rename services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/{writelatex/api/request => snapshot}/push/exception/PostbackTimeoutException.java (89%) rename services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/{writelatex/api/request => snapshot}/push/exception/SevereSnapshotPostException.java (82%) rename services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/{writelatex/api/request => snapshot}/push/exception/SnapshotPostException.java (76%) rename services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/{writelatex/api/request => snapshot}/push/exception/SnapshotPostExceptionBuilder.java (82%) rename services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/{writelatex/api/request => snapshot}/push/exception/UnexpectedErrorException.java (92%) rename services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/{writelatex/api/request => snapshot}/push/exception/UnexpectedPostbackException.java (61%) rename services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/{test => snapshot/servermock}/Main.java (71%) rename services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/{test => snapshot/servermock}/exception/InvalidAPICallException.java (75%) rename services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/{test => snapshot/servermock}/response/SnapshotResponse.java (75%) rename services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/{test => snapshot/servermock}/response/SnapshotResponseBuilder.java (75%) rename services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/{test => snapshot/servermock}/response/getdoc/SnapshotGetDocResponse.java (62%) rename services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/{test => snapshot/servermock}/response/getforver/SnapshotGetForVerResponse.java (62%) rename services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/{test => snapshot/servermock}/response/getsavedver/SnapshotGetSavedVersResponse.java (62%) rename services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/{test => snapshot/servermock}/response/push/SnapshotPushResponse.java (69%) rename services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/{test => snapshot/servermock}/response/push/data/SnapshotPushResult.java (91%) rename services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/{test => snapshot/servermock}/response/push/data/SnapshotPushResultOutOfDate.java (80%) rename services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/{test => snapshot/servermock}/response/push/data/SnapshotPushResultSuccess.java (80%) rename services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/{test => snapshot/servermock}/response/push/postback/SnapshotPostbackRequest.java (84%) rename services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/{test => snapshot/servermock}/response/push/postback/SnapshotPostbackRequestError.java (85%) rename services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/{test => snapshot/servermock}/response/push/postback/SnapshotPostbackRequestInvalidFiles.java (80%) rename services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/{test => snapshot/servermock}/response/push/postback/SnapshotPostbackRequestInvalidProject.java (92%) rename services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/{test => snapshot/servermock}/response/push/postback/SnapshotPostbackRequestOutOfDate.java (85%) rename services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/{test => snapshot/servermock}/response/push/postback/SnapshotPostbackRequestSuccess.java (87%) rename services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/{test => snapshot/servermock}/response/push/postback/invalidfile/InvalidFileError.java (85%) rename services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/{test => snapshot/servermock}/response/push/postback/invalidfile/InvalidFileErrorDefault.java (75%) rename services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/{test => snapshot/servermock}/response/push/postback/invalidfile/InvalidFileErrorDisallowed.java (76%) rename services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/{test => snapshot/servermock}/response/push/postback/invalidfile/InvalidFileErrorUnclean.java (87%) rename services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/{test => snapshot/servermock}/server/MockSnapshotRequestHandler.java (82%) rename services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/{test => snapshot/servermock}/server/MockSnapshotServer.java (88%) rename services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/{test => snapshot/servermock}/server/PostbackThread.java (95%) rename services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/{test => snapshot/servermock}/state/SnapshotAPIState.java (68%) rename services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/{test => snapshot/servermock}/state/SnapshotAPIStateBuilder.java (86%) rename services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/{test => snapshot/servermock}/state/SnapshotAPIStateManager.java (61%) rename services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/{test => snapshot/servermock}/util/FileUtil.java (98%) delete mode 100644 services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/model/db/PersistentStoreUpdater.java rename services/git-bridge/src/test/java/uk/ac/ic/wlgitbridge/{writelatex => data}/model/db/sql/update/delete/DeleteFilesForProjectSQLUpdateTest.java (85%) rename services/git-bridge/src/test/java/uk/ac/ic/wlgitbridge/{test => snapshot/servermock}/util/FileUtilTest.java (60%) rename services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/{test => snapshot/servermock}/util/FileUtilTest/returnsFalseIfFileNamesAreNotEqual/neq1/file.txt (100%) rename services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/{test => snapshot/servermock}/util/FileUtilTest/returnsFalseIfFileNamesAreNotEqual/neq1/neq1.txt (100%) rename services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/{test => snapshot/servermock}/util/FileUtilTest/returnsFalseIfFileNamesAreNotEqual/neq2/file.txt (100%) rename services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/{test => snapshot/servermock}/util/FileUtilTest/returnsFalseIfFileNamesAreNotEqual/neq2/neq2.txt (100%) rename services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/{test => snapshot/servermock}/util/FileUtilTest/returnsFalseIfInnerDirectoryNamesAreNotEqual/neq1/neq1/file.txt (100%) rename services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/{test => snapshot/servermock}/util/FileUtilTest/returnsFalseIfInnerDirectoryNamesAreNotEqual/neq2/neq2/file.txt (100%) rename services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/{test => snapshot/servermock}/util/FileUtilTest/returnsFalseWhenFilesAreNotEqualInBothDirectories/neq1/file.txt (100%) rename services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/{test => snapshot/servermock}/util/FileUtilTest/returnsFalseWhenFilesAreNotEqualInBothDirectories/neq2/file.txt (100%) rename services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/{test => snapshot/servermock}/util/FileUtilTest/returnsFalseWhenRecursiveFilesAreNotEqualInBothDirectories/neq1/dir/file.txt (100%) rename services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/{test => snapshot/servermock}/util/FileUtilTest/returnsFalseWhenRecursiveFilesAreNotEqualInBothDirectories/neq1/file.txt (100%) rename services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/{test => snapshot/servermock}/util/FileUtilTest/returnsFalseWhenRecursiveFilesAreNotEqualInBothDirectories/neq2/dir/file.txt (100%) rename services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/{test => snapshot/servermock}/util/FileUtilTest/returnsFalseWhenRecursiveFilesAreNotEqualInBothDirectories/neq2/file.txt (100%) rename services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/{test => snapshot/servermock}/util/FileUtilTest/returnsTrueEvenIfGitDirectoriesAreNotEqual/eq1/dir/file.txt (100%) rename services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/{test => snapshot/servermock}/util/FileUtilTest/returnsTrueEvenIfGitDirectoriesAreNotEqual/eq1/file.txt (100%) rename services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/{test => snapshot/servermock}/util/FileUtilTest/returnsTrueEvenIfGitDirectoriesAreNotEqual/eq2/dir/file.txt (100%) rename services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/{test => snapshot/servermock}/util/FileUtilTest/returnsTrueEvenIfGitDirectoriesAreNotEqual/eq2/file.txt (100%) rename services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/{test => snapshot/servermock}/util/FileUtilTest/returnsTrueWhenFilesAreEqualInBothDirectories/eq1/file.txt (100%) rename services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/{test => snapshot/servermock}/util/FileUtilTest/returnsTrueWhenFilesAreEqualInBothDirectories/eq2/file.txt (100%) rename services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/{test => snapshot/servermock}/util/FileUtilTest/returnsTrueWhenRecursiveFilesAreEqualInBothDirectories/eq1/dir/file.txt (100%) rename services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/{test => snapshot/servermock}/util/FileUtilTest/returnsTrueWhenRecursiveFilesAreEqualInBothDirectories/eq1/file.txt (100%) rename services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/{test => snapshot/servermock}/util/FileUtilTest/returnsTrueWhenRecursiveFilesAreEqualInBothDirectories/eq2/dir/file.txt (100%) rename services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/{test => snapshot/servermock}/util/FileUtilTest/returnsTrueWhenRecursiveFilesAreEqualInBothDirectories/eq2/file.txt (100%) delete mode 160000 services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/test/util/FileUtilTest/returnsFalseWhenCommitsAreDifferent/neq1 delete mode 160000 services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/test/util/FileUtilTest/returnsFalseWhenCommitsAreDifferent/neq2 delete mode 160000 services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/test/util/FileUtilTest/returnsTrueWhenCommitsAreTheSame/eq1 delete mode 160000 services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/test/util/FileUtilTest/returnsTrueWhenCommitsAreTheSame/eq2 diff --git a/services/git-bridge/pom.xml b/services/git-bridge/pom.xml index 0cf0189531..9377b85d79 100644 --- a/services/git-bridge/pom.xml +++ b/services/git-bridge/pom.xml @@ -4,7 +4,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - groupId + uk.ac.ic.wlgitbridge writelatex-git-bridge 1.0-SNAPSHOT diff --git a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/application/AttsResourceHandler.java b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/application/AttsResourceHandler.java index 758ea772f0..8005076334 100644 --- a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/application/AttsResourceHandler.java +++ b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/application/AttsResourceHandler.java @@ -5,8 +5,8 @@ import org.eclipse.jetty.server.Request; import org.eclipse.jetty.server.handler.ResourceHandler; import org.eclipse.jetty.util.MultiMap; import uk.ac.ic.wlgitbridge.util.Util; -import uk.ac.ic.wlgitbridge.writelatex.WriteLatexAPI; -import uk.ac.ic.wlgitbridge.writelatex.api.request.push.exception.InvalidPostbackKeyException; +import uk.ac.ic.wlgitbridge.bridge.BridgeAPI; +import uk.ac.ic.wlgitbridge.snapshot.push.exception.InvalidPostbackKeyException; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; @@ -18,9 +18,9 @@ import java.io.IOException; */ public class AttsResourceHandler extends ResourceHandler { - private final WriteLatexAPI writeLatexDataSource; + private final BridgeAPI writeLatexDataSource; - public AttsResourceHandler(WriteLatexAPI writeLatexDataSource) { + public AttsResourceHandler(BridgeAPI writeLatexDataSource) { this.writeLatexDataSource = writeLatexDataSource; } diff --git a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/application/Config.java b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/application/Config.java index aece3f9bea..abdaa86261 100644 --- a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/application/Config.java +++ b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/application/Config.java @@ -5,7 +5,7 @@ import com.google.gson.JsonElement; import com.google.gson.JsonObject; import com.google.gson.JsonParseException; import uk.ac.ic.wlgitbridge.application.exception.InvalidConfigFileException; -import uk.ac.ic.wlgitbridge.writelatex.api.request.base.JSONSource; +import uk.ac.ic.wlgitbridge.snapshot.base.JSONSource; import java.io.FileReader; import java.io.IOException; diff --git a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/application/SSLConfig.java b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/application/SSLConfig.java deleted file mode 100644 index 242cca81f7..0000000000 --- a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/application/SSLConfig.java +++ /dev/null @@ -1,28 +0,0 @@ -package uk.ac.ic.wlgitbridge.application; - -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import uk.ac.ic.wlgitbridge.writelatex.api.request.base.JSONSource; - -/** - * Created by Winston on 05/01/15. - */ -public class SSLConfig implements JSONSource { - - private boolean enabled; - - public SSLConfig(JsonObject ssl) { - fromJSON(ssl); - } - - @Override - public void fromJSON(JsonElement json) { - JsonObject obj = json.getAsJsonObject(); - enabled = obj.get("enabled").getAsJsonPrimitive().getAsBoolean(); - } - - public boolean isEnabled() { - return enabled; - } - -} diff --git a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/application/SnapshotPushPostbackContents.java b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/application/SnapshotPushPostbackContents.java index ee330fe5f8..75e98f8472 100644 --- a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/application/SnapshotPushPostbackContents.java +++ b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/application/SnapshotPushPostbackContents.java @@ -3,11 +3,11 @@ package uk.ac.ic.wlgitbridge.application; import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; -import uk.ac.ic.wlgitbridge.bridge.WriteLatexDataSource; -import uk.ac.ic.wlgitbridge.writelatex.api.request.push.exception.SnapshotPostException; -import uk.ac.ic.wlgitbridge.writelatex.api.request.base.JSONSource; -import uk.ac.ic.wlgitbridge.writelatex.api.request.push.exception.UnexpectedPostbackException; -import uk.ac.ic.wlgitbridge.writelatex.api.request.push.exception.SnapshotPostExceptionBuilder; +import uk.ac.ic.wlgitbridge.bridge.BridgeAPI; +import uk.ac.ic.wlgitbridge.snapshot.push.exception.SnapshotPostException; +import uk.ac.ic.wlgitbridge.snapshot.base.JSONSource; +import uk.ac.ic.wlgitbridge.snapshot.push.exception.UnexpectedPostbackException; +import uk.ac.ic.wlgitbridge.snapshot.push.exception.SnapshotPostExceptionBuilder; /** * Created by Winston on 17/11/14. @@ -16,7 +16,7 @@ public class SnapshotPushPostbackContents implements JSONSource { private static final String CODE_SUCCESS = "upToDate"; - private final WriteLatexDataSource writeLatexDataSource; + private final BridgeAPI bridgeAPI; private final String projectName; private final String postbackKey; @@ -25,8 +25,8 @@ public class SnapshotPushPostbackContents implements JSONSource { private int versionID; private SnapshotPostException exception; - public SnapshotPushPostbackContents(WriteLatexDataSource writeLatexDataSource, String projectName, String postbackKey, String contents) { - this.writeLatexDataSource = writeLatexDataSource; + public SnapshotPushPostbackContents(BridgeAPI bridgeAPI, String projectName, String postbackKey, String contents) { + this.bridgeAPI = bridgeAPI; this.projectName = projectName; this.postbackKey = postbackKey; snapshotPostExceptionBuilder = new SnapshotPostExceptionBuilder(); @@ -42,9 +42,9 @@ public class SnapshotPushPostbackContents implements JSONSource { public void processPostback() throws UnexpectedPostbackException { if (exception == null) { - writeLatexDataSource.postbackReceivedSuccessfully(projectName, postbackKey, versionID); + bridgeAPI.postbackReceivedSuccessfully(projectName, postbackKey, versionID); } else { - writeLatexDataSource.postbackReceivedWithException(projectName, postbackKey, exception); + bridgeAPI.postbackReceivedWithException(projectName, postbackKey, exception); } } diff --git a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/application/SnapshotPushPostbackHandler.java b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/application/SnapshotPushPostbackHandler.java index 3c41af21b2..e0e772f070 100644 --- a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/application/SnapshotPushPostbackHandler.java +++ b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/application/SnapshotPushPostbackHandler.java @@ -4,9 +4,9 @@ import com.google.gson.JsonObject; import com.google.gson.JsonPrimitive; import org.eclipse.jetty.server.Request; import org.eclipse.jetty.server.handler.AbstractHandler; -import uk.ac.ic.wlgitbridge.bridge.WriteLatexDataSource; +import uk.ac.ic.wlgitbridge.bridge.BridgeAPI; import uk.ac.ic.wlgitbridge.util.Util; -import uk.ac.ic.wlgitbridge.writelatex.api.request.push.exception.UnexpectedPostbackException; +import uk.ac.ic.wlgitbridge.snapshot.push.exception.UnexpectedPostbackException; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; @@ -18,10 +18,10 @@ import java.io.IOException; */ public class SnapshotPushPostbackHandler extends AbstractHandler { - private final WriteLatexDataSource writeLatexDataSource; + private final BridgeAPI bridgeAPI; - public SnapshotPushPostbackHandler(WriteLatexDataSource writeLatexDataSource) { - this.writeLatexDataSource = writeLatexDataSource; + public SnapshotPushPostbackHandler(BridgeAPI bridgeAPI) { + this.bridgeAPI = bridgeAPI; } @Override @@ -38,7 +38,7 @@ public class SnapshotPushPostbackHandler extends AbstractHandler { String projectName = parts[1]; String postbackKey = parts[2]; Util.sout(baseRequest.getMethod() + " <- " + baseRequest.getUri()); - SnapshotPushPostbackContents postbackContents = new SnapshotPushPostbackContents(writeLatexDataSource, projectName, postbackKey, contents); + SnapshotPushPostbackContents postbackContents = new SnapshotPushPostbackContents(bridgeAPI, projectName, postbackKey, contents); JsonObject body = new JsonObject(); try { diff --git a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/application/WLGitBridgeApplication.java b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/application/WLGitBridgeApplication.java index 1a9e6262e1..49c8d4ae83 100644 --- a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/application/WLGitBridgeApplication.java +++ b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/application/WLGitBridgeApplication.java @@ -26,7 +26,7 @@ public class WLGitBridgeApplication { /** * Constructs an instance of the WriteLatex-Git Bridge application. - * @param args args from main, which should be in the format [port, root_git_directory_path] + * @param args args from main, which should be in the format [config_file] */ public WLGitBridgeApplication(String[] args) { try { diff --git a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/application/WLGitBridgeServer.java b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/application/WLGitBridgeServer.java index d040b51750..67ae60703a 100644 --- a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/application/WLGitBridgeServer.java +++ b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/application/WLGitBridgeServer.java @@ -8,13 +8,12 @@ import org.eclipse.jetty.servlet.ServletContextHandler; import org.eclipse.jetty.servlet.ServletHolder; import org.eclipse.jetty.util.log.Log; import uk.ac.ic.wlgitbridge.application.jetty.NullLogger; -import uk.ac.ic.wlgitbridge.bridge.WriteLatexDataSource; +import uk.ac.ic.wlgitbridge.bridge.BridgeAPI; import uk.ac.ic.wlgitbridge.git.exception.InvalidRootDirectoryPathException; import uk.ac.ic.wlgitbridge.git.servlet.WLGitServlet; import uk.ac.ic.wlgitbridge.util.Util; -import uk.ac.ic.wlgitbridge.writelatex.WriteLatexAPI; -import uk.ac.ic.wlgitbridge.writelatex.api.request.base.SnapshotAPIRequest; -import uk.ac.ic.wlgitbridge.writelatex.model.DataStore; +import uk.ac.ic.wlgitbridge.snapshot.base.SnapshotAPIRequest; +import uk.ac.ic.wlgitbridge.data.model.DataStore; import javax.servlet.ServletException; import java.io.File; @@ -86,7 +85,7 @@ public class WLGitBridgeServer { private void configureJettyServer() throws ServletException, InvalidRootDirectoryPathException { HandlerCollection handlers = new HandlerCollection(); - WriteLatexAPI writeLatexDataSource = new WriteLatexAPI(new DataStore(rootGitDirectoryPath)); + BridgeAPI writeLatexDataSource = new BridgeAPI(new DataStore(rootGitDirectoryPath)); handlers.setHandlers(new Handler[] { initResourceHandler(writeLatexDataSource), new SnapshotPushPostbackHandler(writeLatexDataSource), @@ -95,18 +94,18 @@ public class WLGitBridgeServer { jettyServer.setHandler(handlers); } - private Handler initGitHandler(WriteLatexDataSource writeLatexDataSource) throws ServletException, InvalidRootDirectoryPathException { + private Handler initGitHandler(BridgeAPI bridgeAPI) throws ServletException, InvalidRootDirectoryPathException { final ServletContextHandler servletContextHandler = new ServletContextHandler(ServletContextHandler.SESSIONS); servletContextHandler.setContextPath("/"); servletContextHandler.addServlet( new ServletHolder( - new WLGitServlet(servletContextHandler, writeLatexDataSource, rootGitDirectoryPath)), + new WLGitServlet(servletContextHandler, bridgeAPI, rootGitDirectoryPath)), "/*" ); return servletContextHandler; } - private Handler initResourceHandler(WriteLatexAPI writeLatexDataSource) { + private Handler initResourceHandler(BridgeAPI writeLatexDataSource) { ResourceHandler resourceHandler = new AttsResourceHandler(writeLatexDataSource); resourceHandler.setResourceBase(new File(rootGitDirectoryPath, ".wlgb/atts").getAbsolutePath()); return resourceHandler; diff --git a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/WriteLatexAPI.java b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/bridge/BridgeAPI.java similarity index 80% rename from services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/WriteLatexAPI.java rename to services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/bridge/BridgeAPI.java index cad8b757a8..dd3fc9bbab 100644 --- a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/WriteLatexAPI.java +++ b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/bridge/BridgeAPI.java @@ -1,49 +1,48 @@ -package uk.ac.ic.wlgitbridge.writelatex; +package uk.ac.ic.wlgitbridge.bridge; import org.eclipse.jgit.api.errors.GitAPIException; import org.eclipse.jgit.lib.Repository; import org.eclipse.jgit.transport.ServiceMayNotContinueException; -import uk.ac.ic.wlgitbridge.bridge.RawDirectory; -import uk.ac.ic.wlgitbridge.bridge.WriteLatexDataSource; +import uk.ac.ic.wlgitbridge.data.CandidateSnapshot; +import uk.ac.ic.wlgitbridge.data.ProjectLock; +import uk.ac.ic.wlgitbridge.data.ShutdownHook; +import uk.ac.ic.wlgitbridge.data.model.DataStore; +import uk.ac.ic.wlgitbridge.data.filestore.RawDirectory; +import uk.ac.ic.wlgitbridge.snapshot.exception.FailedConnectionException; +import uk.ac.ic.wlgitbridge.snapshot.getdoc.SnapshotGetDocRequest; +import uk.ac.ic.wlgitbridge.snapshot.getdoc.exception.InvalidProjectException; +import uk.ac.ic.wlgitbridge.snapshot.push.PostbackManager; +import uk.ac.ic.wlgitbridge.snapshot.push.SnapshotPushRequest; +import uk.ac.ic.wlgitbridge.snapshot.push.SnapshotPushRequestResult; +import uk.ac.ic.wlgitbridge.snapshot.push.exception.*; import uk.ac.ic.wlgitbridge.util.Util; -import uk.ac.ic.wlgitbridge.writelatex.api.request.exception.FailedConnectionException; -import uk.ac.ic.wlgitbridge.writelatex.api.request.getdoc.SnapshotGetDocRequest; -import uk.ac.ic.wlgitbridge.writelatex.api.request.getdoc.exception.InvalidProjectException; -import uk.ac.ic.wlgitbridge.writelatex.api.request.push.PostbackManager; -import uk.ac.ic.wlgitbridge.writelatex.api.request.push.SnapshotPushRequest; -import uk.ac.ic.wlgitbridge.writelatex.api.request.push.SnapshotPushRequestResult; -import uk.ac.ic.wlgitbridge.writelatex.api.request.push.exception.*; -import uk.ac.ic.wlgitbridge.writelatex.model.DataStore; import java.io.IOException; /** * Created by Winston on 16/11/14. */ -public class WriteLatexAPI implements WriteLatexDataSource { +public class BridgeAPI { private final DataStore dataModel; private final PostbackManager postbackManager; private final ProjectLock mainProjectLock; - public WriteLatexAPI(DataStore dataModel) { + public BridgeAPI(DataStore dataModel) { this.dataModel = dataModel; postbackManager = new PostbackManager(); mainProjectLock = new ProjectLock(); Runtime.getRuntime().addShutdownHook(new ShutdownHook(mainProjectLock)); } - @Override public void lockForProject(String projectName) { mainProjectLock.lockForProject(projectName); } - @Override public void unlockForProject(String projectName) { mainProjectLock.unlockForProject(projectName); } - @Override public boolean repositoryExists(String projectName) throws ServiceMayNotContinueException { lockForProject(projectName); SnapshotGetDocRequest snapshotGetDocRequest = new SnapshotGetDocRequest(projectName); @@ -62,13 +61,11 @@ public class WriteLatexAPI implements WriteLatexDataSource { return true; } - @Override public void getWritableRepositories(String projectName, Repository repository) throws IOException, SnapshotPostException, GitAPIException { Util.sout("Fetching project: " + projectName); dataModel.updateProjectWithName(projectName, repository); } - @Override public void putDirectoryContentsToProjectWithName(String projectName, RawDirectory directoryContents, RawDirectory oldDirectoryContents, String hostname) throws SnapshotPostException, IOException { mainProjectLock.lockForProject(projectName); CandidateSnapshot candidate = null; @@ -99,18 +96,15 @@ public class WriteLatexAPI implements WriteLatexDataSource { } } - @Override public void checkPostbackKey(String projectName, String postbackKey) throws InvalidPostbackKeyException { postbackManager.checkPostbackKey(projectName, postbackKey); } /* Called by postback thread. */ - @Override public void postbackReceivedSuccessfully(String projectName, String postbackKey, int versionID) throws UnexpectedPostbackException { postbackManager.postVersionIDForProject(projectName, versionID, postbackKey); } - @Override public void postbackReceivedWithException(String projectName, String postbackKey, SnapshotPostException exception) throws UnexpectedPostbackException { postbackManager.postExceptionForProject(projectName, exception, postbackKey); } diff --git a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/bridge/CandidateSnapshotCallback.java b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/bridge/CandidateSnapshotCallback.java deleted file mode 100644 index d98ccf0f3d..0000000000 --- a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/bridge/CandidateSnapshotCallback.java +++ /dev/null @@ -1,12 +0,0 @@ -package uk.ac.ic.wlgitbridge.bridge; - -import uk.ac.ic.wlgitbridge.writelatex.CandidateSnapshot; - -/** - * Created by Winston on 16/11/14. - */ -public interface CandidateSnapshotCallback { - - public void approveSnapshot(int versionID, CandidateSnapshot candidateSnapshot); - -} diff --git a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/bridge/RawDirectory.java b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/bridge/RawDirectory.java deleted file mode 100644 index 9a44f6b1df..0000000000 --- a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/bridge/RawDirectory.java +++ /dev/null @@ -1,11 +0,0 @@ -package uk.ac.ic.wlgitbridge.bridge; - -import java.util.Map; - -/** - * Created by Winston on 16/11/14. - */ -public interface RawDirectory { - - public Map getFileTable(); -} diff --git a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/bridge/RepositorySource.java b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/bridge/RepositorySource.java deleted file mode 100644 index 3d43c9e8bf..0000000000 --- a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/bridge/RepositorySource.java +++ /dev/null @@ -1,16 +0,0 @@ -package uk.ac.ic.wlgitbridge.bridge; - -import org.eclipse.jgit.errors.RepositoryNotFoundException; -import org.eclipse.jgit.lib.Repository; -import org.eclipse.jgit.transport.ServiceMayNotContinueException; - -import java.io.File; - -/** - * Created by Winston on 03/11/14. - */ -public interface RepositorySource { - - public Repository getRepositoryWithNameAtRootDirectory(String name, File rootDirectory) throws RepositoryNotFoundException, ServiceMayNotContinueException; - -} diff --git a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/bridge/WLBridgedProject.java b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/bridge/WLBridgedProject.java index 8f2172bd91..73efd9d70d 100644 --- a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/bridge/WLBridgedProject.java +++ b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/bridge/WLBridgedProject.java @@ -1,18 +1,13 @@ package uk.ac.ic.wlgitbridge.bridge; -import org.eclipse.jgit.api.Git; import org.eclipse.jgit.api.errors.GitAPIException; import org.eclipse.jgit.errors.RepositoryNotFoundException; -import org.eclipse.jgit.lib.PersonIdent; import org.eclipse.jgit.lib.Repository; import org.eclipse.jgit.transport.ServiceMayNotContinueException; -import uk.ac.ic.wlgitbridge.util.Util; -import uk.ac.ic.wlgitbridge.writelatex.api.request.getdoc.exception.InvalidProjectException; -import uk.ac.ic.wlgitbridge.writelatex.api.request.push.exception.SnapshotPostException; +import uk.ac.ic.wlgitbridge.snapshot.getdoc.exception.InvalidProjectException; +import uk.ac.ic.wlgitbridge.snapshot.push.exception.SnapshotPostException; import java.io.IOException; -import java.util.List; -import java.util.TimeZone; /** * Created by Winston on 05/11/14. @@ -21,16 +16,16 @@ public class WLBridgedProject { private final Repository repository; private final String name; - private final WriteLatexDataSource writeLatexDataSource; + private final BridgeAPI bridgeAPI; - public WLBridgedProject(Repository repository, String name, WriteLatexDataSource writeLatexDataSource) { + public WLBridgedProject(Repository repository, String name, BridgeAPI bridgeAPI) { this.repository = repository; this.name = name; - this.writeLatexDataSource = writeLatexDataSource; + this.bridgeAPI = bridgeAPI; } public void buildRepository() throws RepositoryNotFoundException, ServiceMayNotContinueException { - writeLatexDataSource.lockForProject(name); + bridgeAPI.lockForProject(name); try { if (repository.getObjectDatabase().exists()) { updateRepositoryFromSnapshots(repository); @@ -41,13 +36,13 @@ public class WLBridgedProject { e.printStackTrace(); throw new ServiceMayNotContinueException(e); } finally { - writeLatexDataSource.unlockForProject(name); + bridgeAPI.unlockForProject(name); } } private void updateRepositoryFromSnapshots(Repository repository) throws RepositoryNotFoundException, ServiceMayNotContinueException { try { - writeLatexDataSource.getWritableRepositories(name, repository); + bridgeAPI.getWritableRepositories(name, repository); } catch (InvalidProjectException e) { throw new RepositoryNotFoundException(name); } catch (SnapshotPostException e) { @@ -60,7 +55,7 @@ public class WLBridgedProject { } private void buildRepositoryFromScratch(Repository repository) throws RepositoryNotFoundException, ServiceMayNotContinueException { - if (!writeLatexDataSource.repositoryExists(name)) { + if (!bridgeAPI.repositoryExists(name)) { throw new RepositoryNotFoundException(name); } try { diff --git a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/bridge/WritableRepositoryContents.java b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/bridge/WritableRepositoryContents.java deleted file mode 100644 index 40d1df7d72..0000000000 --- a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/bridge/WritableRepositoryContents.java +++ /dev/null @@ -1,23 +0,0 @@ -package uk.ac.ic.wlgitbridge.bridge; - -import uk.ac.ic.wlgitbridge.writelatex.api.request.exception.FailedConnectionException; - -import java.io.File; -import java.io.IOException; -import java.util.Date; - -/** - * Created by Winston on 14/11/14. - */ -public interface WritableRepositoryContents { - - public void write() throws IOException, FailedConnectionException; - - public File getDirectory(); - - public String getUserName(); - public String getUserEmail(); - public String getCommitMessage(); - public Date getWhen(); - -} diff --git a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/bridge/WriteLatexDataSource.java b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/bridge/WriteLatexDataSource.java deleted file mode 100644 index bddebcf505..0000000000 --- a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/bridge/WriteLatexDataSource.java +++ /dev/null @@ -1,33 +0,0 @@ -package uk.ac.ic.wlgitbridge.bridge; - -import org.eclipse.jgit.api.errors.GitAPIException; -import org.eclipse.jgit.lib.Repository; -import org.eclipse.jgit.transport.ServiceMayNotContinueException; -import uk.ac.ic.wlgitbridge.writelatex.api.request.exception.FailedConnectionException; -import uk.ac.ic.wlgitbridge.writelatex.api.request.push.exception.InvalidPostbackKeyException; -import uk.ac.ic.wlgitbridge.writelatex.api.request.push.exception.SnapshotPostException; -import uk.ac.ic.wlgitbridge.writelatex.api.request.push.exception.UnexpectedPostbackException; - -import java.io.IOException; - -/** - * Created by Winston on 03/11/14. - */ -public interface WriteLatexDataSource { - - void lockForProject(String projectName); - - void unlockForProject(String projectName); - - /* Called by request thread. */ - public boolean repositoryExists(String projectName) throws ServiceMayNotContinueException; - public void getWritableRepositories(String projectName, Repository repository) throws IOException, SnapshotPostException, GitAPIException; - public void putDirectoryContentsToProjectWithName(String projectName, RawDirectory directoryContents, RawDirectory oldDirectoryContents, String hostname) throws SnapshotPostException, IOException, FailedConnectionException; - - void checkPostbackKey(String projectName, String postbackKey) throws InvalidPostbackKeyException; - - /* Called by postback thread. */ - public void postbackReceivedSuccessfully(String projectName, String postbackKey, int versionID) throws UnexpectedPostbackException; - public void postbackReceivedWithException(String projectName, String postbackKey, SnapshotPostException exception) throws UnexpectedPostbackException; - -} diff --git a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/CandidateSnapshot.java b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/data/CandidateSnapshot.java similarity index 96% rename from services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/CandidateSnapshot.java rename to services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/data/CandidateSnapshot.java index f40d56afb9..dfed107715 100644 --- a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/CandidateSnapshot.java +++ b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/data/CandidateSnapshot.java @@ -1,10 +1,10 @@ -package uk.ac.ic.wlgitbridge.writelatex; +package uk.ac.ic.wlgitbridge.data; import com.google.gson.JsonArray; import com.google.gson.JsonElement; import com.google.gson.JsonObject; -import uk.ac.ic.wlgitbridge.bridge.RawDirectory; -import uk.ac.ic.wlgitbridge.bridge.RawFile; +import uk.ac.ic.wlgitbridge.data.filestore.RawFile; +import uk.ac.ic.wlgitbridge.data.filestore.RawDirectory; import uk.ac.ic.wlgitbridge.util.Util; import java.io.File; diff --git a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/LockAllWaiter.java b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/data/LockAllWaiter.java similarity index 75% rename from services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/LockAllWaiter.java rename to services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/data/LockAllWaiter.java index 1b35dbf1b7..5f06675af6 100644 --- a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/LockAllWaiter.java +++ b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/data/LockAllWaiter.java @@ -1,4 +1,4 @@ -package uk.ac.ic.wlgitbridge.writelatex; +package uk.ac.ic.wlgitbridge.data; /** * Created by Winston on 21/02/15. diff --git a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/ProjectLock.java b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/data/ProjectLock.java similarity index 97% rename from services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/ProjectLock.java rename to services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/data/ProjectLock.java index 6732b42208..7ae5b09839 100644 --- a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/ProjectLock.java +++ b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/data/ProjectLock.java @@ -1,4 +1,4 @@ -package uk.ac.ic.wlgitbridge.writelatex; +package uk.ac.ic.wlgitbridge.data; import java.util.HashMap; import java.util.Map; diff --git a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/ServletFile.java b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/data/ServletFile.java similarity index 87% rename from services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/ServletFile.java rename to services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/data/ServletFile.java index 80a0ec8452..9c14c6cb89 100644 --- a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/ServletFile.java +++ b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/data/ServletFile.java @@ -1,6 +1,6 @@ -package uk.ac.ic.wlgitbridge.writelatex; +package uk.ac.ic.wlgitbridge.data; -import uk.ac.ic.wlgitbridge.bridge.RawFile; +import uk.ac.ic.wlgitbridge.data.filestore.RawFile; /** * Created by Winston on 21/02/15. diff --git a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/ShutdownHook.java b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/data/ShutdownHook.java similarity index 94% rename from services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/ShutdownHook.java rename to services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/data/ShutdownHook.java index a7577bcb0b..2f92a23bbf 100644 --- a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/ShutdownHook.java +++ b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/data/ShutdownHook.java @@ -1,4 +1,4 @@ -package uk.ac.ic.wlgitbridge.writelatex; +package uk.ac.ic.wlgitbridge.data; import uk.ac.ic.wlgitbridge.util.Util; diff --git a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/SnapshotFetcher.java b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/data/SnapshotFetcher.java similarity index 79% rename from services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/SnapshotFetcher.java rename to services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/data/SnapshotFetcher.java index e0b81f1aa7..5ecdcd6b20 100644 --- a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/SnapshotFetcher.java +++ b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/data/SnapshotFetcher.java @@ -1,14 +1,14 @@ -package uk.ac.ic.wlgitbridge.writelatex; +package uk.ac.ic.wlgitbridge.data; -import uk.ac.ic.wlgitbridge.writelatex.api.request.exception.FailedConnectionException; -import uk.ac.ic.wlgitbridge.writelatex.api.request.getdoc.SnapshotGetDocRequest; -import uk.ac.ic.wlgitbridge.writelatex.api.request.getdoc.SnapshotGetDocResult; -import uk.ac.ic.wlgitbridge.writelatex.api.request.getforversion.SnapshotData; -import uk.ac.ic.wlgitbridge.writelatex.api.request.getforversion.SnapshotGetForVersionRequest; -import uk.ac.ic.wlgitbridge.writelatex.api.request.getsavedvers.SnapshotGetSavedVersRequest; -import uk.ac.ic.wlgitbridge.writelatex.api.request.getsavedvers.SnapshotInfo; -import uk.ac.ic.wlgitbridge.writelatex.api.request.push.exception.SnapshotPostException; -import uk.ac.ic.wlgitbridge.writelatex.model.Snapshot; +import uk.ac.ic.wlgitbridge.snapshot.exception.FailedConnectionException; +import uk.ac.ic.wlgitbridge.snapshot.getdoc.SnapshotGetDocRequest; +import uk.ac.ic.wlgitbridge.snapshot.getdoc.SnapshotGetDocResult; +import uk.ac.ic.wlgitbridge.snapshot.getforversion.SnapshotData; +import uk.ac.ic.wlgitbridge.snapshot.getforversion.SnapshotGetForVersionRequest; +import uk.ac.ic.wlgitbridge.snapshot.getsavedvers.SnapshotGetSavedVersRequest; +import uk.ac.ic.wlgitbridge.snapshot.getsavedvers.SnapshotInfo; +import uk.ac.ic.wlgitbridge.snapshot.push.exception.SnapshotPostException; +import uk.ac.ic.wlgitbridge.data.model.Snapshot; import java.util.*; diff --git a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/SnapshotRepositoryBuilder.java b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/data/SnapshotRepositoryBuilder.java similarity index 61% rename from services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/SnapshotRepositoryBuilder.java rename to services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/data/SnapshotRepositoryBuilder.java index dc5a031108..9c4a0c2eec 100644 --- a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/SnapshotRepositoryBuilder.java +++ b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/data/SnapshotRepositoryBuilder.java @@ -1,14 +1,13 @@ -package uk.ac.ic.wlgitbridge.writelatex; +package uk.ac.ic.wlgitbridge.data; import org.eclipse.jgit.errors.RepositoryNotFoundException; import org.eclipse.jgit.lib.Repository; import org.eclipse.jgit.storage.file.FileRepositoryBuilder; import org.eclipse.jgit.transport.ServiceMayNotContinueException; -import uk.ac.ic.wlgitbridge.bridge.RepositorySource; import uk.ac.ic.wlgitbridge.bridge.WLBridgedProject; -import uk.ac.ic.wlgitbridge.bridge.WriteLatexDataSource; +import uk.ac.ic.wlgitbridge.bridge.BridgeAPI; import uk.ac.ic.wlgitbridge.util.Util; -import uk.ac.ic.wlgitbridge.writelatex.api.request.push.exception.InternalErrorException; +import uk.ac.ic.wlgitbridge.snapshot.push.exception.InternalErrorException; import java.io.File; import java.io.IOException; @@ -16,17 +15,16 @@ import java.io.IOException; /** * Created by Winston on 03/11/14. */ -public class SnapshotRepositoryBuilder implements RepositorySource { +public class SnapshotRepositoryBuilder { - private final WriteLatexDataSource writeLatexDataSource; + private final BridgeAPI bridgeAPI; - public SnapshotRepositoryBuilder(WriteLatexDataSource writeLatexDataSource) { - this.writeLatexDataSource = writeLatexDataSource; + public SnapshotRepositoryBuilder(BridgeAPI bridgeAPI) { + this.bridgeAPI = bridgeAPI; } - @Override public Repository getRepositoryWithNameAtRootDirectory(String name, File rootDirectory) throws RepositoryNotFoundException, ServiceMayNotContinueException { - if (!writeLatexDataSource.repositoryExists(name)) { + if (!bridgeAPI.repositoryExists(name)) { throw new RepositoryNotFoundException(name); } File repositoryDirectory = new File(rootDirectory, name); @@ -34,7 +32,7 @@ public class SnapshotRepositoryBuilder implements RepositorySource { Repository repository = null; try { repository = new FileRepositoryBuilder().setWorkTree(repositoryDirectory).build(); - new WLBridgedProject(repository, name, writeLatexDataSource).buildRepository(); + new WLBridgedProject(repository, name, bridgeAPI).buildRepository(); } catch (IOException e) { Util.printStackTrace(e); throw new ServiceMayNotContinueException(new InternalErrorException().getDescriptionLines().get(0)); diff --git a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/filestore/GitDirectoryContents.java b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/data/filestore/GitDirectoryContents.java similarity index 78% rename from services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/filestore/GitDirectoryContents.java rename to services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/data/filestore/GitDirectoryContents.java index 18043b35bb..686aea680c 100644 --- a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/filestore/GitDirectoryContents.java +++ b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/data/filestore/GitDirectoryContents.java @@ -1,9 +1,7 @@ -package uk.ac.ic.wlgitbridge.writelatex.filestore; +package uk.ac.ic.wlgitbridge.data.filestore; -import uk.ac.ic.wlgitbridge.bridge.RawFile; -import uk.ac.ic.wlgitbridge.bridge.WritableRepositoryContents; +import uk.ac.ic.wlgitbridge.data.model.Snapshot; import uk.ac.ic.wlgitbridge.util.Util; -import uk.ac.ic.wlgitbridge.writelatex.model.Snapshot; import java.io.File; import java.io.IOException; @@ -13,7 +11,7 @@ import java.util.List; /** * Created by Winston on 14/11/14. */ -public class GitDirectoryContents implements WritableRepositoryContents { +public class GitDirectoryContents { private final List files; private final File gitDirectory; @@ -31,7 +29,6 @@ public class GitDirectoryContents implements WritableRepositoryContents { when = snapshot.getCreatedAt(); } - @Override public void write() throws IOException { Util.deleteInDirectoryApartFrom(gitDirectory, ".git"); for (RawFile fileNode : files) { @@ -39,27 +36,22 @@ public class GitDirectoryContents implements WritableRepositoryContents { } } - @Override public File getDirectory() { return gitDirectory; } - @Override public String getUserName() { return userName; } - @Override public String getUserEmail() { return userEmail; } - @Override public String getCommitMessage() { return commitMessage; } - @Override public Date getWhen() { return when; } diff --git a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/data/filestore/RawDirectory.java b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/data/filestore/RawDirectory.java new file mode 100644 index 0000000000..2589519386 --- /dev/null +++ b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/data/filestore/RawDirectory.java @@ -0,0 +1,20 @@ +package uk.ac.ic.wlgitbridge.data.filestore; + +import java.util.Map; + +/** + * Created by Winston on 16/11/14. + */ +public class RawDirectory { + + private final Map fileTable; + + public RawDirectory(Map fileTable) { + this.fileTable = fileTable; + } + + public Map getFileTable() { + return fileTable; + } + +} diff --git a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/bridge/RawFile.java b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/data/filestore/RawFile.java similarity index 95% rename from services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/bridge/RawFile.java rename to services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/data/filestore/RawFile.java index 00c1a5cc97..c37d6ee168 100644 --- a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/bridge/RawFile.java +++ b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/data/filestore/RawFile.java @@ -1,4 +1,4 @@ -package uk.ac.ic.wlgitbridge.bridge; +package uk.ac.ic.wlgitbridge.data.filestore; import java.io.File; import java.io.FileOutputStream; diff --git a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/filestore/RepositoryFile.java b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/data/filestore/RepositoryFile.java similarity index 86% rename from services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/filestore/RepositoryFile.java rename to services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/data/filestore/RepositoryFile.java index e1e19dd8da..465c23bfec 100644 --- a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/filestore/RepositoryFile.java +++ b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/data/filestore/RepositoryFile.java @@ -1,6 +1,4 @@ -package uk.ac.ic.wlgitbridge.writelatex.filestore; - -import uk.ac.ic.wlgitbridge.bridge.RawFile; +package uk.ac.ic.wlgitbridge.data.filestore; import java.util.Map.Entry; diff --git a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/model/DataStore.java b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/data/model/DataStore.java similarity index 84% rename from services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/model/DataStore.java rename to services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/data/model/DataStore.java index d7eed7bec4..6f9e7eb74d 100644 --- a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/model/DataStore.java +++ b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/data/model/DataStore.java @@ -1,20 +1,19 @@ -package uk.ac.ic.wlgitbridge.writelatex.model; +package uk.ac.ic.wlgitbridge.data.model; import org.eclipse.jgit.api.Git; import org.eclipse.jgit.api.errors.GitAPIException; import org.eclipse.jgit.lib.PersonIdent; import org.eclipse.jgit.lib.Repository; -import uk.ac.ic.wlgitbridge.bridge.CandidateSnapshotCallback; -import uk.ac.ic.wlgitbridge.bridge.RawDirectory; -import uk.ac.ic.wlgitbridge.bridge.RawFile; +import uk.ac.ic.wlgitbridge.data.filestore.RawFile; +import uk.ac.ic.wlgitbridge.data.CandidateSnapshot; +import uk.ac.ic.wlgitbridge.data.SnapshotFetcher; +import uk.ac.ic.wlgitbridge.data.filestore.GitDirectoryContents; +import uk.ac.ic.wlgitbridge.data.model.db.PersistentStore; +import uk.ac.ic.wlgitbridge.data.filestore.RawDirectory; +import uk.ac.ic.wlgitbridge.snapshot.exception.FailedConnectionException; +import uk.ac.ic.wlgitbridge.snapshot.getforversion.SnapshotAttachment; +import uk.ac.ic.wlgitbridge.snapshot.push.exception.SnapshotPostException; import uk.ac.ic.wlgitbridge.util.Util; -import uk.ac.ic.wlgitbridge.writelatex.CandidateSnapshot; -import uk.ac.ic.wlgitbridge.writelatex.SnapshotFetcher; -import uk.ac.ic.wlgitbridge.writelatex.api.request.exception.FailedConnectionException; -import uk.ac.ic.wlgitbridge.writelatex.api.request.getforversion.SnapshotAttachment; -import uk.ac.ic.wlgitbridge.writelatex.api.request.push.exception.SnapshotPostException; -import uk.ac.ic.wlgitbridge.writelatex.filestore.GitDirectoryContents; -import uk.ac.ic.wlgitbridge.writelatex.model.db.PersistentStore; import java.io.File; import java.io.IOException; @@ -26,7 +25,7 @@ import java.util.TimeZone; /** * Created by Winston on 06/11/14. */ -public class DataStore implements CandidateSnapshotCallback { +public class DataStore { private final File rootGitDirectory; private final PersistentStore persistentStore; @@ -87,7 +86,6 @@ public class DataStore implements CandidateSnapshotCallback { return candidateSnapshot; } - @Override public void approveSnapshot(int versionID, CandidateSnapshot candidateSnapshot) { List deleted = candidateSnapshot.getDeleted(); persistentStore.setLatestVersionForProject(candidateSnapshot.getProjectName(), versionID); diff --git a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/model/ResourceFetcher.java b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/data/model/ResourceFetcher.java similarity index 89% rename from services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/model/ResourceFetcher.java rename to services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/data/model/ResourceFetcher.java index 745bc360cb..dca41fed63 100644 --- a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/model/ResourceFetcher.java +++ b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/data/model/ResourceFetcher.java @@ -1,15 +1,15 @@ -package uk.ac.ic.wlgitbridge.writelatex.model; +package uk.ac.ic.wlgitbridge.data.model; import com.ning.http.client.AsyncCompletionHandler; import com.ning.http.client.HttpResponseBodyPart; import com.ning.http.client.Response; import org.eclipse.jgit.lib.Repository; -import uk.ac.ic.wlgitbridge.bridge.RawFile; +import uk.ac.ic.wlgitbridge.data.filestore.RawFile; +import uk.ac.ic.wlgitbridge.data.filestore.RepositoryFile; import uk.ac.ic.wlgitbridge.git.util.RepositoryObjectTreeWalker; +import uk.ac.ic.wlgitbridge.snapshot.base.Request; +import uk.ac.ic.wlgitbridge.snapshot.exception.FailedConnectionException; import uk.ac.ic.wlgitbridge.util.Util; -import uk.ac.ic.wlgitbridge.writelatex.api.request.base.Request; -import uk.ac.ic.wlgitbridge.writelatex.api.request.exception.FailedConnectionException; -import uk.ac.ic.wlgitbridge.writelatex.filestore.RepositoryFile; import java.io.ByteArrayOutputStream; import java.io.IOException; diff --git a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/model/Snapshot.java b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/data/model/Snapshot.java similarity index 81% rename from services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/model/Snapshot.java rename to services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/data/model/Snapshot.java index bd814c22a7..06463bcc02 100644 --- a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/model/Snapshot.java +++ b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/data/model/Snapshot.java @@ -1,12 +1,12 @@ -package uk.ac.ic.wlgitbridge.writelatex.model; +package uk.ac.ic.wlgitbridge.data.model; import org.joda.time.DateTime; import uk.ac.ic.wlgitbridge.util.Util; -import uk.ac.ic.wlgitbridge.writelatex.api.request.getforversion.SnapshotAttachment; -import uk.ac.ic.wlgitbridge.writelatex.api.request.getforversion.SnapshotData; -import uk.ac.ic.wlgitbridge.writelatex.api.request.getforversion.SnapshotFile; -import uk.ac.ic.wlgitbridge.writelatex.api.request.getsavedvers.SnapshotInfo; -import uk.ac.ic.wlgitbridge.writelatex.api.request.getsavedvers.WLUser; +import uk.ac.ic.wlgitbridge.snapshot.getforversion.SnapshotAttachment; +import uk.ac.ic.wlgitbridge.snapshot.getforversion.SnapshotData; +import uk.ac.ic.wlgitbridge.snapshot.getforversion.SnapshotFile; +import uk.ac.ic.wlgitbridge.snapshot.getsavedvers.SnapshotInfo; +import uk.ac.ic.wlgitbridge.snapshot.getsavedvers.WLUser; import java.util.*; diff --git a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/model/URLIndexStore.java b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/data/model/URLIndexStore.java similarity index 83% rename from services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/model/URLIndexStore.java rename to services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/data/model/URLIndexStore.java index 4e911fdedd..4d89162d3d 100644 --- a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/model/URLIndexStore.java +++ b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/data/model/URLIndexStore.java @@ -1,4 +1,4 @@ -package uk.ac.ic.wlgitbridge.writelatex.model; +package uk.ac.ic.wlgitbridge.data.model; /** * Created by Winston on 21/02/15. diff --git a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/model/db/PersistentStore.java b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/data/model/db/PersistentStore.java similarity index 91% rename from services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/model/db/PersistentStore.java rename to services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/data/model/db/PersistentStore.java index d9b6b7bd7e..1da9abeabe 100644 --- a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/model/db/PersistentStore.java +++ b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/data/model/db/PersistentStore.java @@ -1,7 +1,7 @@ -package uk.ac.ic.wlgitbridge.writelatex.model.db; +package uk.ac.ic.wlgitbridge.data.model.db; -import uk.ac.ic.wlgitbridge.writelatex.model.URLIndexStore; -import uk.ac.ic.wlgitbridge.writelatex.model.db.sql.SQLiteWLDatabase; +import uk.ac.ic.wlgitbridge.data.model.URLIndexStore; +import uk.ac.ic.wlgitbridge.data.model.db.sql.SQLiteWLDatabase; import java.io.File; import java.sql.SQLException; diff --git a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/model/db/sql/SQLQuery.java b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/data/model/db/sql/SQLQuery.java similarity index 80% rename from services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/model/db/sql/SQLQuery.java rename to services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/data/model/db/sql/SQLQuery.java index 4e90af1881..df0c2869d4 100644 --- a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/model/db/sql/SQLQuery.java +++ b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/data/model/db/sql/SQLQuery.java @@ -1,4 +1,4 @@ -package uk.ac.ic.wlgitbridge.writelatex.model.db.sql; +package uk.ac.ic.wlgitbridge.data.model.db.sql; import java.sql.ResultSet; import java.sql.SQLException; diff --git a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/model/db/sql/SQLUpdate.java b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/data/model/db/sql/SQLUpdate.java similarity index 82% rename from services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/model/db/sql/SQLUpdate.java rename to services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/data/model/db/sql/SQLUpdate.java index 815d581dc0..097e2b1188 100644 --- a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/model/db/sql/SQLUpdate.java +++ b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/data/model/db/sql/SQLUpdate.java @@ -1,4 +1,4 @@ -package uk.ac.ic.wlgitbridge.writelatex.model.db.sql; +package uk.ac.ic.wlgitbridge.data.model.db.sql; import java.sql.PreparedStatement; import java.sql.SQLException; diff --git a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/model/db/sql/SQLiteWLDatabase.java b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/data/model/db/sql/SQLiteWLDatabase.java similarity index 77% rename from services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/model/db/sql/SQLiteWLDatabase.java rename to services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/data/model/db/sql/SQLiteWLDatabase.java index f335b9d277..b042bc4a32 100644 --- a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/model/db/sql/SQLiteWLDatabase.java +++ b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/data/model/db/sql/SQLiteWLDatabase.java @@ -1,14 +1,14 @@ -package uk.ac.ic.wlgitbridge.writelatex.model.db.sql; +package uk.ac.ic.wlgitbridge.data.model.db.sql; -import uk.ac.ic.wlgitbridge.writelatex.model.db.sql.query.GetLatestVersionForProjectSQLQuery; -import uk.ac.ic.wlgitbridge.writelatex.model.db.sql.query.GetPathForURLInProjectSQLQuery; -import uk.ac.ic.wlgitbridge.writelatex.model.db.sql.query.GetProjectNamesSQLQuery; -import uk.ac.ic.wlgitbridge.writelatex.model.db.sql.update.create.CreateIndexURLIndexStore; -import uk.ac.ic.wlgitbridge.writelatex.model.db.sql.update.create.CreateProjectsTableSQLUpdate; -import uk.ac.ic.wlgitbridge.writelatex.model.db.sql.update.create.CreateURLIndexStoreSQLUpdate; -import uk.ac.ic.wlgitbridge.writelatex.model.db.sql.update.delete.DeleteFilesForProjectSQLUpdate; -import uk.ac.ic.wlgitbridge.writelatex.model.db.sql.update.insert.AddURLIndexSQLUpdate; -import uk.ac.ic.wlgitbridge.writelatex.model.db.sql.update.insert.SetProjectSQLUpdate; +import uk.ac.ic.wlgitbridge.data.model.db.sql.query.GetLatestVersionForProjectSQLQuery; +import uk.ac.ic.wlgitbridge.data.model.db.sql.query.GetPathForURLInProjectSQLQuery; +import uk.ac.ic.wlgitbridge.data.model.db.sql.query.GetProjectNamesSQLQuery; +import uk.ac.ic.wlgitbridge.data.model.db.sql.update.create.CreateIndexURLIndexStore; +import uk.ac.ic.wlgitbridge.data.model.db.sql.update.create.CreateProjectsTableSQLUpdate; +import uk.ac.ic.wlgitbridge.data.model.db.sql.update.create.CreateURLIndexStoreSQLUpdate; +import uk.ac.ic.wlgitbridge.data.model.db.sql.update.delete.DeleteFilesForProjectSQLUpdate; +import uk.ac.ic.wlgitbridge.data.model.db.sql.update.insert.AddURLIndexSQLUpdate; +import uk.ac.ic.wlgitbridge.data.model.db.sql.update.insert.SetProjectSQLUpdate; import java.io.File; import java.sql.*; diff --git a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/model/db/sql/query/GetLatestVersionForProjectSQLQuery.java b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/data/model/db/sql/query/GetLatestVersionForProjectSQLQuery.java similarity index 89% rename from services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/model/db/sql/query/GetLatestVersionForProjectSQLQuery.java rename to services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/data/model/db/sql/query/GetLatestVersionForProjectSQLQuery.java index 1f03f69f99..49c1a7d447 100644 --- a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/model/db/sql/query/GetLatestVersionForProjectSQLQuery.java +++ b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/data/model/db/sql/query/GetLatestVersionForProjectSQLQuery.java @@ -1,6 +1,6 @@ -package uk.ac.ic.wlgitbridge.writelatex.model.db.sql.query; +package uk.ac.ic.wlgitbridge.data.model.db.sql.query; -import uk.ac.ic.wlgitbridge.writelatex.model.db.sql.SQLQuery; +import uk.ac.ic.wlgitbridge.data.model.db.sql.SQLQuery; import java.sql.PreparedStatement; import java.sql.ResultSet; diff --git a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/model/db/sql/query/GetPathForURLInProjectSQLQuery.java b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/data/model/db/sql/query/GetPathForURLInProjectSQLQuery.java similarity index 90% rename from services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/model/db/sql/query/GetPathForURLInProjectSQLQuery.java rename to services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/data/model/db/sql/query/GetPathForURLInProjectSQLQuery.java index 3927683403..a449ecc8a5 100644 --- a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/model/db/sql/query/GetPathForURLInProjectSQLQuery.java +++ b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/data/model/db/sql/query/GetPathForURLInProjectSQLQuery.java @@ -1,6 +1,6 @@ -package uk.ac.ic.wlgitbridge.writelatex.model.db.sql.query; +package uk.ac.ic.wlgitbridge.data.model.db.sql.query; -import uk.ac.ic.wlgitbridge.writelatex.model.db.sql.SQLQuery; +import uk.ac.ic.wlgitbridge.data.model.db.sql.SQLQuery; import java.sql.PreparedStatement; import java.sql.ResultSet; diff --git a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/model/db/sql/query/GetProjectNamesSQLQuery.java b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/data/model/db/sql/query/GetProjectNamesSQLQuery.java similarity index 87% rename from services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/model/db/sql/query/GetProjectNamesSQLQuery.java rename to services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/data/model/db/sql/query/GetProjectNamesSQLQuery.java index 0854eae85e..0985c3402a 100644 --- a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/model/db/sql/query/GetProjectNamesSQLQuery.java +++ b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/data/model/db/sql/query/GetProjectNamesSQLQuery.java @@ -1,6 +1,6 @@ -package uk.ac.ic.wlgitbridge.writelatex.model.db.sql.query; +package uk.ac.ic.wlgitbridge.data.model.db.sql.query; -import uk.ac.ic.wlgitbridge.writelatex.model.db.sql.SQLQuery; +import uk.ac.ic.wlgitbridge.data.model.db.sql.SQLQuery; import java.sql.PreparedStatement; import java.sql.ResultSet; diff --git a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/model/db/sql/update/create/CreateIndexURLIndexStore.java b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/data/model/db/sql/update/create/CreateIndexURLIndexStore.java similarity index 81% rename from services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/model/db/sql/update/create/CreateIndexURLIndexStore.java rename to services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/data/model/db/sql/update/create/CreateIndexURLIndexStore.java index 1c212a73b8..6666722ff6 100644 --- a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/model/db/sql/update/create/CreateIndexURLIndexStore.java +++ b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/data/model/db/sql/update/create/CreateIndexURLIndexStore.java @@ -1,6 +1,6 @@ -package uk.ac.ic.wlgitbridge.writelatex.model.db.sql.update.create; +package uk.ac.ic.wlgitbridge.data.model.db.sql.update.create; -import uk.ac.ic.wlgitbridge.writelatex.model.db.sql.SQLUpdate; +import uk.ac.ic.wlgitbridge.data.model.db.sql.SQLUpdate; import java.sql.PreparedStatement; import java.sql.SQLException; diff --git a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/model/db/sql/update/create/CreateProjectsTableSQLUpdate.java b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/data/model/db/sql/update/create/CreateProjectsTableSQLUpdate.java similarity index 83% rename from services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/model/db/sql/update/create/CreateProjectsTableSQLUpdate.java rename to services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/data/model/db/sql/update/create/CreateProjectsTableSQLUpdate.java index 67c4d7aeb2..6ac597148a 100644 --- a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/model/db/sql/update/create/CreateProjectsTableSQLUpdate.java +++ b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/data/model/db/sql/update/create/CreateProjectsTableSQLUpdate.java @@ -1,6 +1,6 @@ -package uk.ac.ic.wlgitbridge.writelatex.model.db.sql.update.create; +package uk.ac.ic.wlgitbridge.data.model.db.sql.update.create; -import uk.ac.ic.wlgitbridge.writelatex.model.db.sql.SQLUpdate; +import uk.ac.ic.wlgitbridge.data.model.db.sql.SQLUpdate; import java.sql.PreparedStatement; import java.sql.SQLException; diff --git a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/model/db/sql/update/create/CreateURLIndexStoreSQLUpdate.java b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/data/model/db/sql/update/create/CreateURLIndexStoreSQLUpdate.java similarity index 87% rename from services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/model/db/sql/update/create/CreateURLIndexStoreSQLUpdate.java rename to services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/data/model/db/sql/update/create/CreateURLIndexStoreSQLUpdate.java index 62ce58b2d3..0ecf77e6d9 100644 --- a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/model/db/sql/update/create/CreateURLIndexStoreSQLUpdate.java +++ b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/data/model/db/sql/update/create/CreateURLIndexStoreSQLUpdate.java @@ -1,6 +1,6 @@ -package uk.ac.ic.wlgitbridge.writelatex.model.db.sql.update.create; +package uk.ac.ic.wlgitbridge.data.model.db.sql.update.create; -import uk.ac.ic.wlgitbridge.writelatex.model.db.sql.SQLUpdate; +import uk.ac.ic.wlgitbridge.data.model.db.sql.SQLUpdate; import java.sql.PreparedStatement; import java.sql.SQLException; diff --git a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/model/db/sql/update/delete/DeleteFilesForProjectSQLUpdate.java b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/data/model/db/sql/update/delete/DeleteFilesForProjectSQLUpdate.java similarity index 90% rename from services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/model/db/sql/update/delete/DeleteFilesForProjectSQLUpdate.java rename to services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/data/model/db/sql/update/delete/DeleteFilesForProjectSQLUpdate.java index 4fef0e1431..db9ef39f95 100644 --- a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/model/db/sql/update/delete/DeleteFilesForProjectSQLUpdate.java +++ b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/data/model/db/sql/update/delete/DeleteFilesForProjectSQLUpdate.java @@ -1,6 +1,6 @@ -package uk.ac.ic.wlgitbridge.writelatex.model.db.sql.update.delete; +package uk.ac.ic.wlgitbridge.data.model.db.sql.update.delete; -import uk.ac.ic.wlgitbridge.writelatex.model.db.sql.SQLUpdate; +import uk.ac.ic.wlgitbridge.data.model.db.sql.SQLUpdate; import java.sql.PreparedStatement; import java.sql.SQLException; diff --git a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/model/db/sql/update/insert/AddURLIndexSQLUpdate.java b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/data/model/db/sql/update/insert/AddURLIndexSQLUpdate.java similarity index 87% rename from services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/model/db/sql/update/insert/AddURLIndexSQLUpdate.java rename to services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/data/model/db/sql/update/insert/AddURLIndexSQLUpdate.java index 8c6ee53372..48e6badb0b 100644 --- a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/model/db/sql/update/insert/AddURLIndexSQLUpdate.java +++ b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/data/model/db/sql/update/insert/AddURLIndexSQLUpdate.java @@ -1,6 +1,6 @@ -package uk.ac.ic.wlgitbridge.writelatex.model.db.sql.update.insert; +package uk.ac.ic.wlgitbridge.data.model.db.sql.update.insert; -import uk.ac.ic.wlgitbridge.writelatex.model.db.sql.SQLUpdate; +import uk.ac.ic.wlgitbridge.data.model.db.sql.SQLUpdate; import java.sql.PreparedStatement; import java.sql.SQLException; diff --git a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/model/db/sql/update/insert/SetProjectSQLUpdate.java b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/data/model/db/sql/update/insert/SetProjectSQLUpdate.java similarity index 85% rename from services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/model/db/sql/update/insert/SetProjectSQLUpdate.java rename to services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/data/model/db/sql/update/insert/SetProjectSQLUpdate.java index 9c9951453d..4db17c9d1b 100644 --- a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/model/db/sql/update/insert/SetProjectSQLUpdate.java +++ b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/data/model/db/sql/update/insert/SetProjectSQLUpdate.java @@ -1,6 +1,6 @@ -package uk.ac.ic.wlgitbridge.writelatex.model.db.sql.update.insert; +package uk.ac.ic.wlgitbridge.data.model.db.sql.update.insert; -import uk.ac.ic.wlgitbridge.writelatex.model.db.sql.SQLUpdate; +import uk.ac.ic.wlgitbridge.data.model.db.sql.SQLUpdate; import java.sql.PreparedStatement; import java.sql.SQLException; diff --git a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/git/handler/WLReceivePackFactory.java b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/git/handler/WLReceivePackFactory.java index d78d3d4906..aba50c95b8 100644 --- a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/git/handler/WLReceivePackFactory.java +++ b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/git/handler/WLReceivePackFactory.java @@ -5,7 +5,7 @@ import org.eclipse.jgit.transport.ReceivePack; import org.eclipse.jgit.transport.resolver.ReceivePackFactory; import org.eclipse.jgit.transport.resolver.ServiceNotAuthorizedException; import org.eclipse.jgit.transport.resolver.ServiceNotEnabledException; -import uk.ac.ic.wlgitbridge.bridge.WriteLatexDataSource; +import uk.ac.ic.wlgitbridge.bridge.BridgeAPI; import uk.ac.ic.wlgitbridge.git.handler.hook.WriteLatexPutHook; import uk.ac.ic.wlgitbridge.util.Util; @@ -17,10 +17,10 @@ import javax.servlet.http.HttpServletRequest; /* */ public class WLReceivePackFactory implements ReceivePackFactory { - private final WriteLatexDataSource writeLatexDataSource; + private final BridgeAPI bridgeAPI; - public WLReceivePackFactory(WriteLatexDataSource writeLatexDataSource) { - this.writeLatexDataSource = writeLatexDataSource; + public WLReceivePackFactory(BridgeAPI bridgeAPI) { + this.bridgeAPI = bridgeAPI; } @Override @@ -30,7 +30,7 @@ public class WLReceivePackFactory implements ReceivePackFactory { private File rootGitDirectory; - private RepositorySource repositorySource; + private SnapshotRepositoryBuilder snapshotRepositoryBuilder; public WLRepositoryResolver(String rootGitDirectoryPath, SnapshotRepositoryBuilder repositorySource) throws InvalidRootDirectoryPathException { - this.repositorySource = repositorySource; + this.snapshotRepositoryBuilder = repositorySource; initRootGitDirectory(rootGitDirectoryPath); } @Override public Repository open(HttpServletRequest httpServletRequest, String name) throws RepositoryNotFoundException, ServiceNotAuthorizedException, ServiceNotEnabledException, ServiceMayNotContinueException { try { - return repositorySource.getRepositoryWithNameAtRootDirectory(Util.removeAllSuffixes(name, "/", ".git"), rootGitDirectory); + return snapshotRepositoryBuilder.getRepositoryWithNameAtRootDirectory(Util.removeAllSuffixes(name, "/", ".git"), rootGitDirectory); } catch (RepositoryNotFoundException e) { Util.printStackTrace(e); throw e; diff --git a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/git/handler/hook/WriteLatexPutHook.java b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/git/handler/hook/WriteLatexPutHook.java index c9bbc56bdf..ebd1fc3d48 100644 --- a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/git/handler/hook/WriteLatexPutHook.java +++ b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/git/handler/hook/WriteLatexPutHook.java @@ -5,16 +5,16 @@ import org.eclipse.jgit.transport.PreReceiveHook; import org.eclipse.jgit.transport.ReceiveCommand; import org.eclipse.jgit.transport.ReceiveCommand.Result; import org.eclipse.jgit.transport.ReceivePack; -import uk.ac.ic.wlgitbridge.bridge.RawDirectory; -import uk.ac.ic.wlgitbridge.bridge.WriteLatexDataSource; +import uk.ac.ic.wlgitbridge.bridge.BridgeAPI; import uk.ac.ic.wlgitbridge.git.handler.hook.exception.ForcedPushException; import uk.ac.ic.wlgitbridge.git.handler.hook.exception.WrongBranchException; +import uk.ac.ic.wlgitbridge.data.filestore.RawDirectory; import uk.ac.ic.wlgitbridge.git.util.RepositoryObjectTreeWalker; +import uk.ac.ic.wlgitbridge.snapshot.exception.FailedConnectionException; +import uk.ac.ic.wlgitbridge.snapshot.push.exception.InternalErrorException; +import uk.ac.ic.wlgitbridge.snapshot.push.exception.OutOfDateException; +import uk.ac.ic.wlgitbridge.snapshot.push.exception.SnapshotPostException; import uk.ac.ic.wlgitbridge.util.Util; -import uk.ac.ic.wlgitbridge.writelatex.api.request.exception.FailedConnectionException; -import uk.ac.ic.wlgitbridge.writelatex.api.request.push.exception.InternalErrorException; -import uk.ac.ic.wlgitbridge.writelatex.api.request.push.exception.OutOfDateException; -import uk.ac.ic.wlgitbridge.writelatex.api.request.push.exception.SnapshotPostException; import java.io.IOException; import java.util.Collection; @@ -24,11 +24,11 @@ import java.util.Collection; */ public class WriteLatexPutHook implements PreReceiveHook { - private final WriteLatexDataSource writeLatexDataSource; + private final BridgeAPI bridgeAPI; private final String hostname; - public WriteLatexPutHook(WriteLatexDataSource writeLatexDataSource, String hostname) { - this.writeLatexDataSource = writeLatexDataSource; + public WriteLatexPutHook(BridgeAPI bridgeAPI, String hostname) { + this.bridgeAPI = bridgeAPI; this.hostname = hostname; } @@ -63,7 +63,7 @@ public class WriteLatexPutHook implements PreReceiveHook { private void handleReceiveCommand(Repository repository, ReceiveCommand receiveCommand) throws IOException, SnapshotPostException, FailedConnectionException { checkBranch(receiveCommand); checkForcedPush(receiveCommand); - writeLatexDataSource.putDirectoryContentsToProjectWithName(repository.getWorkTree().getName(), + bridgeAPI.putDirectoryContentsToProjectWithName(repository.getWorkTree().getName(), getPushedDirectoryContents(repository, receiveCommand), getOldDirectoryContents(repository), diff --git a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/git/handler/hook/exception/ForcedPushException.java b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/git/handler/hook/exception/ForcedPushException.java index b29d071002..d17aca1741 100644 --- a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/git/handler/hook/exception/ForcedPushException.java +++ b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/git/handler/hook/exception/ForcedPushException.java @@ -2,7 +2,7 @@ package uk.ac.ic.wlgitbridge.git.handler.hook.exception; import com.google.gson.JsonElement; import uk.ac.ic.wlgitbridge.util.Util; -import uk.ac.ic.wlgitbridge.writelatex.api.request.push.exception.SnapshotPostException; +import uk.ac.ic.wlgitbridge.snapshot.push.exception.SnapshotPostException; import java.util.Arrays; import java.util.List; diff --git a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/git/handler/hook/exception/WrongBranchException.java b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/git/handler/hook/exception/WrongBranchException.java index 481f5e33d2..a2d4f32e88 100644 --- a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/git/handler/hook/exception/WrongBranchException.java +++ b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/git/handler/hook/exception/WrongBranchException.java @@ -1,7 +1,7 @@ package uk.ac.ic.wlgitbridge.git.handler.hook.exception; import com.google.gson.JsonElement; -import uk.ac.ic.wlgitbridge.writelatex.api.request.push.exception.SnapshotPostException; +import uk.ac.ic.wlgitbridge.snapshot.push.exception.SnapshotPostException; import java.util.Arrays; import java.util.List; diff --git a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/git/servlet/WLGitServlet.java b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/git/servlet/WLGitServlet.java index fcb76fccab..ad746b6d81 100644 --- a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/git/servlet/WLGitServlet.java +++ b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/git/servlet/WLGitServlet.java @@ -6,8 +6,8 @@ import uk.ac.ic.wlgitbridge.git.exception.InvalidRootDirectoryPathException; import uk.ac.ic.wlgitbridge.git.handler.WLReceivePackFactory; import uk.ac.ic.wlgitbridge.git.handler.WLRepositoryResolver; import uk.ac.ic.wlgitbridge.git.handler.WLUploadPackFactory; -import uk.ac.ic.wlgitbridge.writelatex.SnapshotRepositoryBuilder; -import uk.ac.ic.wlgitbridge.bridge.WriteLatexDataSource; +import uk.ac.ic.wlgitbridge.data.SnapshotRepositoryBuilder; +import uk.ac.ic.wlgitbridge.bridge.BridgeAPI; import javax.servlet.ServletException; @@ -16,9 +16,9 @@ import javax.servlet.ServletException; */ public class WLGitServlet extends GitServlet { - public WLGitServlet(ServletContextHandler servletContextHandler, WriteLatexDataSource writeLatexDataSource, String rootGitDirectoryPath) throws ServletException, InvalidRootDirectoryPathException { - setRepositoryResolver(new WLRepositoryResolver(rootGitDirectoryPath, new SnapshotRepositoryBuilder(writeLatexDataSource))); - setReceivePackFactory(new WLReceivePackFactory(writeLatexDataSource)); + public WLGitServlet(ServletContextHandler servletContextHandler, BridgeAPI bridgeAPI, String rootGitDirectoryPath) throws ServletException, InvalidRootDirectoryPathException { + setRepositoryResolver(new WLRepositoryResolver(rootGitDirectoryPath, new SnapshotRepositoryBuilder(bridgeAPI))); + setReceivePackFactory(new WLReceivePackFactory(bridgeAPI)); setUploadPackFactory(new WLUploadPackFactory()); init(new WLGitServletConfig(servletContextHandler)); } diff --git a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/git/util/FileDirectory.java b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/git/util/FileDirectory.java deleted file mode 100644 index 884dfc7776..0000000000 --- a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/git/util/FileDirectory.java +++ /dev/null @@ -1,24 +0,0 @@ -package uk.ac.ic.wlgitbridge.git.util; - -import uk.ac.ic.wlgitbridge.bridge.RawDirectory; -import uk.ac.ic.wlgitbridge.bridge.RawFile; - -import java.util.Map; - -/** - * Created by Winston on 16/11/14. - */ -public class FileDirectory implements RawDirectory { - - private final Map fileTable; - - public FileDirectory(Map fileTable) { - this.fileTable = fileTable; - } - - @Override - public Map getFileTable() { - return fileTable; - } - -} diff --git a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/git/util/RepositoryObjectTreeWalker.java b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/git/util/RepositoryObjectTreeWalker.java index 60ef601a45..9ea31897da 100644 --- a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/git/util/RepositoryObjectTreeWalker.java +++ b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/git/util/RepositoryObjectTreeWalker.java @@ -4,9 +4,9 @@ import org.eclipse.jgit.lib.ObjectId; import org.eclipse.jgit.lib.Repository; import org.eclipse.jgit.revwalk.RevWalk; import org.eclipse.jgit.treewalk.TreeWalk; -import uk.ac.ic.wlgitbridge.bridge.RawDirectory; -import uk.ac.ic.wlgitbridge.bridge.RawFile; -import uk.ac.ic.wlgitbridge.writelatex.filestore.RepositoryFile; +import uk.ac.ic.wlgitbridge.data.filestore.RawDirectory; +import uk.ac.ic.wlgitbridge.data.filestore.RawFile; +import uk.ac.ic.wlgitbridge.data.filestore.RepositoryFile; import java.io.IOException; import java.util.HashMap; @@ -34,7 +34,7 @@ public class RepositoryObjectTreeWalker { } public RawDirectory getDirectoryContents() throws IOException { - return new FileDirectory(walkGitObjectTree()); + return new RawDirectory(walkGitObjectTree()); } private TreeWalk initTreeWalk(Repository repository, ObjectId objectId) throws IOException { diff --git a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/api/request/base/HTTPMethod.java b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/base/HTTPMethod.java similarity index 61% rename from services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/api/request/base/HTTPMethod.java rename to services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/base/HTTPMethod.java index 893661b1a7..6fdf488483 100644 --- a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/api/request/base/HTTPMethod.java +++ b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/base/HTTPMethod.java @@ -1,4 +1,4 @@ -package uk.ac.ic.wlgitbridge.writelatex.api.request.base; +package uk.ac.ic.wlgitbridge.snapshot.base; /** * Created by Winston on 16/11/14. diff --git a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/api/request/base/JSONSource.java b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/base/JSONSource.java similarity index 74% rename from services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/api/request/base/JSONSource.java rename to services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/base/JSONSource.java index 9236c5e5ea..b85e8cef2e 100644 --- a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/api/request/base/JSONSource.java +++ b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/base/JSONSource.java @@ -1,4 +1,4 @@ -package uk.ac.ic.wlgitbridge.writelatex.api.request.base; +package uk.ac.ic.wlgitbridge.snapshot.base; import com.google.gson.JsonElement; diff --git a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/api/request/base/Request.java b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/base/Request.java similarity index 94% rename from services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/api/request/base/Request.java rename to services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/base/Request.java index baac4a6be4..807c343885 100644 --- a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/api/request/base/Request.java +++ b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/base/Request.java @@ -1,4 +1,4 @@ -package uk.ac.ic.wlgitbridge.writelatex.api.request.base; +package uk.ac.ic.wlgitbridge.snapshot.base; import com.google.gson.Gson; import com.google.gson.JsonElement; @@ -7,8 +7,8 @@ import com.ning.http.client.AsyncHttpClient; import com.ning.http.client.AsyncHttpClient.BoundRequestBuilder; import com.ning.http.client.Realm; import com.ning.http.client.Response; +import uk.ac.ic.wlgitbridge.snapshot.exception.FailedConnectionException; import uk.ac.ic.wlgitbridge.util.Util; -import uk.ac.ic.wlgitbridge.writelatex.api.request.exception.FailedConnectionException; import java.util.concurrent.ExecutionException; import java.util.concurrent.Future; diff --git a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/api/request/base/Result.java b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/base/Result.java similarity index 91% rename from services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/api/request/base/Result.java rename to services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/base/Result.java index 5b23cc978d..05dc4c8af4 100644 --- a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/api/request/base/Result.java +++ b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/base/Result.java @@ -1,4 +1,4 @@ -package uk.ac.ic.wlgitbridge.writelatex.api.request.base; +package uk.ac.ic.wlgitbridge.snapshot.base; import com.google.gson.JsonElement; diff --git a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/api/request/base/SnapshotAPIRequest.java b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/base/SnapshotAPIRequest.java similarity index 94% rename from services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/api/request/base/SnapshotAPIRequest.java rename to services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/base/SnapshotAPIRequest.java index 2d96ae5ec8..c5075495a9 100644 --- a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/api/request/base/SnapshotAPIRequest.java +++ b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/base/SnapshotAPIRequest.java @@ -1,4 +1,4 @@ -package uk.ac.ic.wlgitbridge.writelatex.api.request.base; +package uk.ac.ic.wlgitbridge.snapshot.base; import com.ning.http.client.Realm; diff --git a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/api/request/exception/FailedConnectionException.java b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/exception/FailedConnectionException.java similarity index 85% rename from services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/api/request/exception/FailedConnectionException.java rename to services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/exception/FailedConnectionException.java index 2e003e29d4..770e2a129b 100644 --- a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/api/request/exception/FailedConnectionException.java +++ b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/exception/FailedConnectionException.java @@ -1,4 +1,4 @@ -package uk.ac.ic.wlgitbridge.writelatex.api.request.exception; +package uk.ac.ic.wlgitbridge.snapshot.exception; import org.eclipse.jgit.transport.ServiceMayNotContinueException; import uk.ac.ic.wlgitbridge.util.Util; diff --git a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/api/request/getdoc/SnapshotGetDocRequest.java b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/getdoc/SnapshotGetDocRequest.java similarity index 66% rename from services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/api/request/getdoc/SnapshotGetDocRequest.java rename to services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/getdoc/SnapshotGetDocRequest.java index 81cd4937d6..7a8197ace3 100644 --- a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/api/request/getdoc/SnapshotGetDocRequest.java +++ b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/getdoc/SnapshotGetDocRequest.java @@ -1,9 +1,9 @@ -package uk.ac.ic.wlgitbridge.writelatex.api.request.getdoc; +package uk.ac.ic.wlgitbridge.snapshot.getdoc; import com.google.gson.JsonElement; -import uk.ac.ic.wlgitbridge.writelatex.api.request.base.HTTPMethod; -import uk.ac.ic.wlgitbridge.writelatex.api.request.base.SnapshotAPIRequest; -import uk.ac.ic.wlgitbridge.writelatex.api.request.exception.FailedConnectionException; +import uk.ac.ic.wlgitbridge.snapshot.base.HTTPMethod; +import uk.ac.ic.wlgitbridge.snapshot.base.SnapshotAPIRequest; +import uk.ac.ic.wlgitbridge.snapshot.exception.FailedConnectionException; /** * Created by Winston on 06/11/14. diff --git a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/api/request/getdoc/SnapshotGetDocResult.java b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/getdoc/SnapshotGetDocResult.java similarity index 85% rename from services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/api/request/getdoc/SnapshotGetDocResult.java rename to services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/getdoc/SnapshotGetDocResult.java index c2dcb8c6fa..9b15bc9720 100644 --- a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/api/request/getdoc/SnapshotGetDocResult.java +++ b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/getdoc/SnapshotGetDocResult.java @@ -1,13 +1,13 @@ -package uk.ac.ic.wlgitbridge.writelatex.api.request.getdoc; +package uk.ac.ic.wlgitbridge.snapshot.getdoc; import com.google.gson.JsonElement; import com.google.gson.JsonObject; -import uk.ac.ic.wlgitbridge.writelatex.api.request.base.Request; -import uk.ac.ic.wlgitbridge.writelatex.api.request.base.Result; -import uk.ac.ic.wlgitbridge.writelatex.api.request.exception.FailedConnectionException; -import uk.ac.ic.wlgitbridge.writelatex.api.request.getdoc.exception.InvalidProjectException; -import uk.ac.ic.wlgitbridge.writelatex.api.request.getdoc.exception.ProtectedProjectException; -import uk.ac.ic.wlgitbridge.writelatex.api.request.push.exception.SnapshotPostException; +import uk.ac.ic.wlgitbridge.snapshot.base.Result; +import uk.ac.ic.wlgitbridge.snapshot.exception.FailedConnectionException; +import uk.ac.ic.wlgitbridge.snapshot.getdoc.exception.InvalidProjectException; +import uk.ac.ic.wlgitbridge.snapshot.push.exception.SnapshotPostException; +import uk.ac.ic.wlgitbridge.snapshot.base.Request; +import uk.ac.ic.wlgitbridge.snapshot.getdoc.exception.ProtectedProjectException; /** * Created by Winston on 06/11/14. diff --git a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/api/request/getdoc/exception/InvalidProjectException.java b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/getdoc/exception/InvalidProjectException.java similarity index 85% rename from services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/api/request/getdoc/exception/InvalidProjectException.java rename to services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/getdoc/exception/InvalidProjectException.java index 50e3fc69ef..e6e895a483 100644 --- a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/api/request/getdoc/exception/InvalidProjectException.java +++ b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/getdoc/exception/InvalidProjectException.java @@ -1,9 +1,9 @@ -package uk.ac.ic.wlgitbridge.writelatex.api.request.getdoc.exception; +package uk.ac.ic.wlgitbridge.snapshot.getdoc.exception; import com.google.gson.JsonArray; import com.google.gson.JsonElement; import com.google.gson.JsonObject; -import uk.ac.ic.wlgitbridge.writelatex.api.request.push.exception.SnapshotPostException; +import uk.ac.ic.wlgitbridge.snapshot.push.exception.SnapshotPostException; import java.util.LinkedList; import java.util.List; diff --git a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/api/request/getdoc/exception/ProtectedProjectException.java b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/getdoc/exception/ProtectedProjectException.java similarity index 77% rename from services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/api/request/getdoc/exception/ProtectedProjectException.java rename to services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/getdoc/exception/ProtectedProjectException.java index 059d99f8c6..97a2bb27d4 100644 --- a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/api/request/getdoc/exception/ProtectedProjectException.java +++ b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/getdoc/exception/ProtectedProjectException.java @@ -1,7 +1,7 @@ -package uk.ac.ic.wlgitbridge.writelatex.api.request.getdoc.exception; +package uk.ac.ic.wlgitbridge.snapshot.getdoc.exception; import com.google.gson.JsonElement; -import uk.ac.ic.wlgitbridge.writelatex.api.request.push.exception.SnapshotPostException; +import uk.ac.ic.wlgitbridge.snapshot.push.exception.SnapshotPostException; import java.util.Arrays; import java.util.List; diff --git a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/api/request/getforversion/SnapshotAttachment.java b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/getforversion/SnapshotAttachment.java similarity index 88% rename from services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/api/request/getforversion/SnapshotAttachment.java rename to services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/getforversion/SnapshotAttachment.java index 1fab3be78d..eaf96dc75f 100644 --- a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/api/request/getforversion/SnapshotAttachment.java +++ b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/getforversion/SnapshotAttachment.java @@ -1,9 +1,9 @@ -package uk.ac.ic.wlgitbridge.writelatex.api.request.getforversion; +package uk.ac.ic.wlgitbridge.snapshot.getforversion; import com.google.gson.JsonArray; import com.google.gson.JsonElement; import com.google.gson.JsonPrimitive; -import uk.ac.ic.wlgitbridge.writelatex.api.request.base.JSONSource; +import uk.ac.ic.wlgitbridge.snapshot.base.JSONSource; /** * Created by Winston on 06/11/14. diff --git a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/api/request/getforversion/SnapshotData.java b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/getforversion/SnapshotData.java similarity index 93% rename from services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/api/request/getforversion/SnapshotData.java rename to services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/getforversion/SnapshotData.java index fcf954e396..cfd27abdba 100644 --- a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/api/request/getforversion/SnapshotData.java +++ b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/getforversion/SnapshotData.java @@ -1,9 +1,9 @@ -package uk.ac.ic.wlgitbridge.writelatex.api.request.getforversion; +package uk.ac.ic.wlgitbridge.snapshot.getforversion; import com.google.gson.JsonArray; import com.google.gson.JsonElement; import com.google.gson.JsonObject; -import uk.ac.ic.wlgitbridge.writelatex.api.request.base.JSONSource; +import uk.ac.ic.wlgitbridge.snapshot.base.JSONSource; import java.util.LinkedList; import java.util.List; diff --git a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/api/request/getforversion/SnapshotFile.java b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/getforversion/SnapshotFile.java similarity index 87% rename from services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/api/request/getforversion/SnapshotFile.java rename to services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/getforversion/SnapshotFile.java index 12fed28c4c..22056d206c 100644 --- a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/api/request/getforversion/SnapshotFile.java +++ b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/getforversion/SnapshotFile.java @@ -1,10 +1,10 @@ -package uk.ac.ic.wlgitbridge.writelatex.api.request.getforversion; +package uk.ac.ic.wlgitbridge.snapshot.getforversion; import com.google.gson.JsonArray; import com.google.gson.JsonElement; import com.google.gson.JsonPrimitive; -import uk.ac.ic.wlgitbridge.bridge.RawFile; -import uk.ac.ic.wlgitbridge.writelatex.api.request.base.JSONSource; +import uk.ac.ic.wlgitbridge.data.filestore.RawFile; +import uk.ac.ic.wlgitbridge.snapshot.base.JSONSource; /** * Created by Winston on 06/11/14. diff --git a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/api/request/getforversion/SnapshotGetForVersionRequest.java b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/getforversion/SnapshotGetForVersionRequest.java similarity index 72% rename from services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/api/request/getforversion/SnapshotGetForVersionRequest.java rename to services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/getforversion/SnapshotGetForVersionRequest.java index 788fe4ccdb..152514a1f4 100644 --- a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/api/request/getforversion/SnapshotGetForVersionRequest.java +++ b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/getforversion/SnapshotGetForVersionRequest.java @@ -1,9 +1,9 @@ -package uk.ac.ic.wlgitbridge.writelatex.api.request.getforversion; +package uk.ac.ic.wlgitbridge.snapshot.getforversion; import com.google.gson.JsonElement; -import uk.ac.ic.wlgitbridge.writelatex.api.request.base.HTTPMethod; -import uk.ac.ic.wlgitbridge.writelatex.api.request.base.SnapshotAPIRequest; -import uk.ac.ic.wlgitbridge.writelatex.api.request.exception.FailedConnectionException; +import uk.ac.ic.wlgitbridge.snapshot.base.HTTPMethod; +import uk.ac.ic.wlgitbridge.snapshot.base.SnapshotAPIRequest; +import uk.ac.ic.wlgitbridge.snapshot.exception.FailedConnectionException; /** * Created by Winston on 06/11/14. diff --git a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/api/request/getforversion/SnapshotGetForVersionResult.java b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/getforversion/SnapshotGetForVersionResult.java similarity index 78% rename from services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/api/request/getforversion/SnapshotGetForVersionResult.java rename to services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/getforversion/SnapshotGetForVersionResult.java index 27e6e595c6..215823f296 100644 --- a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/api/request/getforversion/SnapshotGetForVersionResult.java +++ b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/getforversion/SnapshotGetForVersionResult.java @@ -1,8 +1,8 @@ -package uk.ac.ic.wlgitbridge.writelatex.api.request.getforversion; +package uk.ac.ic.wlgitbridge.snapshot.getforversion; import com.google.gson.JsonElement; -import uk.ac.ic.wlgitbridge.writelatex.api.request.base.Request; -import uk.ac.ic.wlgitbridge.writelatex.api.request.base.Result; +import uk.ac.ic.wlgitbridge.snapshot.base.Request; +import uk.ac.ic.wlgitbridge.snapshot.base.Result; /** * Created by Winston on 06/11/14. diff --git a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/api/request/getsavedvers/SnapshotGetSavedVersRequest.java b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/getsavedvers/SnapshotGetSavedVersRequest.java similarity index 67% rename from services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/api/request/getsavedvers/SnapshotGetSavedVersRequest.java rename to services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/getsavedvers/SnapshotGetSavedVersRequest.java index 86f34b8373..5fcc0323a6 100644 --- a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/api/request/getsavedvers/SnapshotGetSavedVersRequest.java +++ b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/getsavedvers/SnapshotGetSavedVersRequest.java @@ -1,9 +1,9 @@ -package uk.ac.ic.wlgitbridge.writelatex.api.request.getsavedvers; +package uk.ac.ic.wlgitbridge.snapshot.getsavedvers; import com.google.gson.JsonElement; -import uk.ac.ic.wlgitbridge.writelatex.api.request.base.HTTPMethod; -import uk.ac.ic.wlgitbridge.writelatex.api.request.base.SnapshotAPIRequest; -import uk.ac.ic.wlgitbridge.writelatex.api.request.exception.FailedConnectionException; +import uk.ac.ic.wlgitbridge.snapshot.base.SnapshotAPIRequest; +import uk.ac.ic.wlgitbridge.snapshot.exception.FailedConnectionException; +import uk.ac.ic.wlgitbridge.snapshot.base.HTTPMethod; /** * Created by Winston on 06/11/14. diff --git a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/api/request/getsavedvers/SnapshotGetSavedVersResult.java b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/getsavedvers/SnapshotGetSavedVersResult.java similarity index 85% rename from services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/api/request/getsavedvers/SnapshotGetSavedVersResult.java rename to services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/getsavedvers/SnapshotGetSavedVersResult.java index a2c5732b78..5249c3c524 100644 --- a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/api/request/getsavedvers/SnapshotGetSavedVersResult.java +++ b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/getsavedvers/SnapshotGetSavedVersResult.java @@ -1,12 +1,12 @@ -package uk.ac.ic.wlgitbridge.writelatex.api.request.getsavedvers; +package uk.ac.ic.wlgitbridge.snapshot.getsavedvers; import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; import com.google.gson.JsonObject; -import uk.ac.ic.wlgitbridge.writelatex.api.request.base.Request; -import uk.ac.ic.wlgitbridge.writelatex.api.request.base.Result; -import uk.ac.ic.wlgitbridge.writelatex.api.request.exception.FailedConnectionException; +import uk.ac.ic.wlgitbridge.snapshot.base.Result; +import uk.ac.ic.wlgitbridge.snapshot.base.Request; +import uk.ac.ic.wlgitbridge.snapshot.exception.FailedConnectionException; import java.util.LinkedList; import java.util.List; diff --git a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/api/request/getsavedvers/SnapshotInfo.java b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/getsavedvers/SnapshotInfo.java similarity index 95% rename from services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/api/request/getsavedvers/SnapshotInfo.java rename to services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/getsavedvers/SnapshotInfo.java index a98c41c5c0..f64665cc71 100644 --- a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/api/request/getsavedvers/SnapshotInfo.java +++ b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/getsavedvers/SnapshotInfo.java @@ -1,4 +1,4 @@ -package uk.ac.ic.wlgitbridge.writelatex.api.request.getsavedvers; +package uk.ac.ic.wlgitbridge.snapshot.getsavedvers; import uk.ac.ic.wlgitbridge.util.Util; diff --git a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/api/request/getsavedvers/WLUser.java b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/getsavedvers/WLUser.java similarity index 88% rename from services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/api/request/getsavedvers/WLUser.java rename to services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/getsavedvers/WLUser.java index 8129fe31a3..5a67e05392 100644 --- a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/api/request/getsavedvers/WLUser.java +++ b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/getsavedvers/WLUser.java @@ -1,4 +1,4 @@ -package uk.ac.ic.wlgitbridge.writelatex.api.request.getsavedvers; +package uk.ac.ic.wlgitbridge.snapshot.getsavedvers; import uk.ac.ic.wlgitbridge.util.Util; diff --git a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/api/request/push/PostbackContents.java b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/push/PostbackContents.java similarity index 83% rename from services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/api/request/push/PostbackContents.java rename to services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/push/PostbackContents.java index 4b4f6487a7..3a476eb33b 100644 --- a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/api/request/push/PostbackContents.java +++ b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/push/PostbackContents.java @@ -1,9 +1,9 @@ -package uk.ac.ic.wlgitbridge.writelatex.api.request.push; +package uk.ac.ic.wlgitbridge.snapshot.push; -import uk.ac.ic.wlgitbridge.writelatex.api.request.push.exception.InternalErrorException; -import uk.ac.ic.wlgitbridge.writelatex.api.request.push.exception.InvalidPostbackKeyException; -import uk.ac.ic.wlgitbridge.writelatex.api.request.push.exception.PostbackTimeoutException; -import uk.ac.ic.wlgitbridge.writelatex.api.request.push.exception.SnapshotPostException; +import uk.ac.ic.wlgitbridge.snapshot.push.exception.InternalErrorException; +import uk.ac.ic.wlgitbridge.snapshot.push.exception.PostbackTimeoutException; +import uk.ac.ic.wlgitbridge.snapshot.push.exception.SnapshotPostException; +import uk.ac.ic.wlgitbridge.snapshot.push.exception.InvalidPostbackKeyException; import java.util.concurrent.TimeUnit; import java.util.concurrent.locks.Condition; diff --git a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/api/request/push/PostbackManager.java b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/push/PostbackManager.java similarity index 86% rename from services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/api/request/push/PostbackManager.java rename to services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/push/PostbackManager.java index 843a53e455..f9cfc2ae72 100644 --- a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/api/request/push/PostbackManager.java +++ b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/push/PostbackManager.java @@ -1,8 +1,8 @@ -package uk.ac.ic.wlgitbridge.writelatex.api.request.push; +package uk.ac.ic.wlgitbridge.snapshot.push; -import uk.ac.ic.wlgitbridge.writelatex.api.request.push.exception.InvalidPostbackKeyException; -import uk.ac.ic.wlgitbridge.writelatex.api.request.push.exception.SnapshotPostException; -import uk.ac.ic.wlgitbridge.writelatex.api.request.push.exception.UnexpectedPostbackException; +import uk.ac.ic.wlgitbridge.snapshot.push.exception.InvalidPostbackKeyException; +import uk.ac.ic.wlgitbridge.snapshot.push.exception.SnapshotPostException; +import uk.ac.ic.wlgitbridge.snapshot.push.exception.UnexpectedPostbackException; import java.math.BigInteger; import java.security.SecureRandom; diff --git a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/api/request/push/SnapshotPushRequest.java b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/push/SnapshotPushRequest.java similarity index 74% rename from services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/api/request/push/SnapshotPushRequest.java rename to services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/push/SnapshotPushRequest.java index a91f280368..657128fa2b 100644 --- a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/api/request/push/SnapshotPushRequest.java +++ b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/push/SnapshotPushRequest.java @@ -1,10 +1,10 @@ -package uk.ac.ic.wlgitbridge.writelatex.api.request.push; +package uk.ac.ic.wlgitbridge.snapshot.push; import com.google.gson.JsonElement; -import uk.ac.ic.wlgitbridge.writelatex.CandidateSnapshot; -import uk.ac.ic.wlgitbridge.writelatex.api.request.base.HTTPMethod; -import uk.ac.ic.wlgitbridge.writelatex.api.request.base.SnapshotAPIRequest; -import uk.ac.ic.wlgitbridge.writelatex.api.request.exception.FailedConnectionException; +import uk.ac.ic.wlgitbridge.data.CandidateSnapshot; +import uk.ac.ic.wlgitbridge.snapshot.base.HTTPMethod; +import uk.ac.ic.wlgitbridge.snapshot.base.SnapshotAPIRequest; +import uk.ac.ic.wlgitbridge.snapshot.exception.FailedConnectionException; /** * Created by Winston on 16/11/14. diff --git a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/api/request/push/SnapshotPushRequestResult.java b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/push/SnapshotPushRequestResult.java similarity index 76% rename from services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/api/request/push/SnapshotPushRequestResult.java rename to services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/push/SnapshotPushRequestResult.java index ec25cbea22..14c20f77ae 100644 --- a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/api/request/push/SnapshotPushRequestResult.java +++ b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/push/SnapshotPushRequestResult.java @@ -1,10 +1,10 @@ -package uk.ac.ic.wlgitbridge.writelatex.api.request.push; +package uk.ac.ic.wlgitbridge.snapshot.push; import com.google.gson.JsonElement; import com.google.gson.JsonObject; -import uk.ac.ic.wlgitbridge.writelatex.api.request.base.Request; -import uk.ac.ic.wlgitbridge.writelatex.api.request.base.Result; -import uk.ac.ic.wlgitbridge.writelatex.api.request.exception.FailedConnectionException; +import uk.ac.ic.wlgitbridge.snapshot.base.Result; +import uk.ac.ic.wlgitbridge.snapshot.base.Request; +import uk.ac.ic.wlgitbridge.snapshot.exception.FailedConnectionException; /** * Created by Winston on 16/11/14. diff --git a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/api/request/push/exception/InternalErrorException.java b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/push/exception/InternalErrorException.java similarity index 90% rename from services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/api/request/push/exception/InternalErrorException.java rename to services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/push/exception/InternalErrorException.java index 78b700099e..b9d7edbeff 100644 --- a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/api/request/push/exception/InternalErrorException.java +++ b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/push/exception/InternalErrorException.java @@ -1,4 +1,4 @@ -package uk.ac.ic.wlgitbridge.writelatex.api.request.push.exception; +package uk.ac.ic.wlgitbridge.snapshot.push.exception; import com.google.gson.JsonElement; import uk.ac.ic.wlgitbridge.util.Util; diff --git a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/api/request/push/exception/InvalidFilesException.java b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/push/exception/InvalidFilesException.java similarity index 96% rename from services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/api/request/push/exception/InvalidFilesException.java rename to services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/push/exception/InvalidFilesException.java index 1b5e5ff455..b0bfab251b 100644 --- a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/api/request/push/exception/InvalidFilesException.java +++ b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/push/exception/InvalidFilesException.java @@ -1,4 +1,4 @@ -package uk.ac.ic.wlgitbridge.writelatex.api.request.push.exception; +package uk.ac.ic.wlgitbridge.snapshot.push.exception; import com.google.gson.JsonArray; import com.google.gson.JsonElement; diff --git a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/api/request/push/exception/InvalidPostbackKeyException.java b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/push/exception/InvalidPostbackKeyException.java similarity index 61% rename from services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/api/request/push/exception/InvalidPostbackKeyException.java rename to services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/push/exception/InvalidPostbackKeyException.java index 7197e1b03a..9057bb8c7c 100644 --- a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/api/request/push/exception/InvalidPostbackKeyException.java +++ b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/push/exception/InvalidPostbackKeyException.java @@ -1,4 +1,4 @@ -package uk.ac.ic.wlgitbridge.writelatex.api.request.push.exception; +package uk.ac.ic.wlgitbridge.snapshot.push.exception; /** * Created by Winston on 04/12/14. diff --git a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/api/request/push/exception/InvalidProjectException.java b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/push/exception/InvalidProjectException.java similarity index 92% rename from services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/api/request/push/exception/InvalidProjectException.java rename to services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/push/exception/InvalidProjectException.java index a24188360a..f9ac328d43 100644 --- a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/api/request/push/exception/InvalidProjectException.java +++ b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/push/exception/InvalidProjectException.java @@ -1,4 +1,4 @@ -package uk.ac.ic.wlgitbridge.writelatex.api.request.push.exception; +package uk.ac.ic.wlgitbridge.snapshot.push.exception; import com.google.gson.JsonArray; import com.google.gson.JsonElement; diff --git a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/api/request/push/exception/OutOfDateException.java b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/push/exception/OutOfDateException.java similarity index 90% rename from services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/api/request/push/exception/OutOfDateException.java rename to services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/push/exception/OutOfDateException.java index 2c26bce328..579271bcae 100644 --- a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/api/request/push/exception/OutOfDateException.java +++ b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/push/exception/OutOfDateException.java @@ -1,4 +1,4 @@ -package uk.ac.ic.wlgitbridge.writelatex.api.request.push.exception; +package uk.ac.ic.wlgitbridge.snapshot.push.exception; import com.google.gson.JsonElement; import com.google.gson.JsonObject; diff --git a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/api/request/push/exception/PostbackTimeoutException.java b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/push/exception/PostbackTimeoutException.java similarity index 89% rename from services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/api/request/push/exception/PostbackTimeoutException.java rename to services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/push/exception/PostbackTimeoutException.java index e99306f430..b230971b8f 100644 --- a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/api/request/push/exception/PostbackTimeoutException.java +++ b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/push/exception/PostbackTimeoutException.java @@ -1,4 +1,4 @@ -package uk.ac.ic.wlgitbridge.writelatex.api.request.push.exception; +package uk.ac.ic.wlgitbridge.snapshot.push.exception; import com.google.gson.JsonElement; import uk.ac.ic.wlgitbridge.util.Util; diff --git a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/api/request/push/exception/SevereSnapshotPostException.java b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/push/exception/SevereSnapshotPostException.java similarity index 82% rename from services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/api/request/push/exception/SevereSnapshotPostException.java rename to services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/push/exception/SevereSnapshotPostException.java index a365f9ed58..fd389822f5 100644 --- a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/api/request/push/exception/SevereSnapshotPostException.java +++ b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/push/exception/SevereSnapshotPostException.java @@ -1,4 +1,4 @@ -package uk.ac.ic.wlgitbridge.writelatex.api.request.push.exception; +package uk.ac.ic.wlgitbridge.snapshot.push.exception; import com.google.gson.JsonElement; diff --git a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/api/request/push/exception/SnapshotPostException.java b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/push/exception/SnapshotPostException.java similarity index 76% rename from services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/api/request/push/exception/SnapshotPostException.java rename to services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/push/exception/SnapshotPostException.java index b5634f2cf1..6252642eef 100644 --- a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/api/request/push/exception/SnapshotPostException.java +++ b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/push/exception/SnapshotPostException.java @@ -1,7 +1,7 @@ -package uk.ac.ic.wlgitbridge.writelatex.api.request.push.exception; +package uk.ac.ic.wlgitbridge.snapshot.push.exception; import com.google.gson.JsonElement; -import uk.ac.ic.wlgitbridge.writelatex.api.request.base.JSONSource; +import uk.ac.ic.wlgitbridge.snapshot.base.JSONSource; import java.util.List; diff --git a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/api/request/push/exception/SnapshotPostExceptionBuilder.java b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/push/exception/SnapshotPostExceptionBuilder.java similarity index 82% rename from services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/api/request/push/exception/SnapshotPostExceptionBuilder.java rename to services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/push/exception/SnapshotPostExceptionBuilder.java index a11fff1eef..8fb9844c88 100644 --- a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/api/request/push/exception/SnapshotPostExceptionBuilder.java +++ b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/push/exception/SnapshotPostExceptionBuilder.java @@ -1,7 +1,6 @@ -package uk.ac.ic.wlgitbridge.writelatex.api.request.push.exception; +package uk.ac.ic.wlgitbridge.snapshot.push.exception; import com.google.gson.JsonObject; -import uk.ac.ic.wlgitbridge.writelatex.api.request.getdoc.exception.InvalidProjectException; /** * Created by Winston on 17/11/14. @@ -19,7 +18,7 @@ public class SnapshotPostExceptionBuilder { } else if (errorCode.equals(CODE_ERROR_INVALID_FILES)) { return new InvalidFilesException(json); } else if (errorCode.equals(CODE_ERROR_INVALID_PROJECT)) { - return new InvalidProjectException(json); + return new uk.ac.ic.wlgitbridge.snapshot.getdoc.exception.InvalidProjectException(json); } else if (errorCode.equals(CODE_ERROR_UNKNOWN)) { return new UnexpectedErrorException(json); } else { diff --git a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/api/request/push/exception/UnexpectedErrorException.java b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/push/exception/UnexpectedErrorException.java similarity index 92% rename from services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/api/request/push/exception/UnexpectedErrorException.java rename to services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/push/exception/UnexpectedErrorException.java index 5d7889af50..f62181980c 100644 --- a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/api/request/push/exception/UnexpectedErrorException.java +++ b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/push/exception/UnexpectedErrorException.java @@ -1,4 +1,4 @@ -package uk.ac.ic.wlgitbridge.writelatex.api.request.push.exception; +package uk.ac.ic.wlgitbridge.snapshot.push.exception; import com.google.gson.JsonElement; import com.google.gson.JsonObject; diff --git a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/api/request/push/exception/UnexpectedPostbackException.java b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/push/exception/UnexpectedPostbackException.java similarity index 61% rename from services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/api/request/push/exception/UnexpectedPostbackException.java rename to services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/push/exception/UnexpectedPostbackException.java index e5d9515007..b3e8460ae1 100644 --- a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/api/request/push/exception/UnexpectedPostbackException.java +++ b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/push/exception/UnexpectedPostbackException.java @@ -1,4 +1,4 @@ -package uk.ac.ic.wlgitbridge.writelatex.api.request.push.exception; +package uk.ac.ic.wlgitbridge.snapshot.push.exception; /** * Created by Winston on 17/11/14. diff --git a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/test/Main.java b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/servermock/Main.java similarity index 71% rename from services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/test/Main.java rename to services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/servermock/Main.java index 52b38263f7..790276bfda 100644 --- a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/test/Main.java +++ b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/servermock/Main.java @@ -1,7 +1,7 @@ -package uk.ac.ic.wlgitbridge.test; +package uk.ac.ic.wlgitbridge.snapshot.servermock; -import uk.ac.ic.wlgitbridge.test.server.MockSnapshotServer; -import uk.ac.ic.wlgitbridge.test.state.SnapshotAPIStateBuilder; +import uk.ac.ic.wlgitbridge.snapshot.servermock.server.MockSnapshotServer; +import uk.ac.ic.wlgitbridge.snapshot.servermock.state.SnapshotAPIStateBuilder; import java.io.File; import java.io.FileInputStream; diff --git a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/test/exception/InvalidAPICallException.java b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/servermock/exception/InvalidAPICallException.java similarity index 75% rename from services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/test/exception/InvalidAPICallException.java rename to services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/servermock/exception/InvalidAPICallException.java index 959f99380f..ac80157ee1 100644 --- a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/test/exception/InvalidAPICallException.java +++ b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/servermock/exception/InvalidAPICallException.java @@ -1,4 +1,4 @@ -package uk.ac.ic.wlgitbridge.test.exception; +package uk.ac.ic.wlgitbridge.snapshot.servermock.exception; /** * Created by Winston on 09/01/15. diff --git a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/test/response/SnapshotResponse.java b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/servermock/response/SnapshotResponse.java similarity index 75% rename from services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/test/response/SnapshotResponse.java rename to services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/servermock/response/SnapshotResponse.java index 3aeb94a0b4..fadad1deb0 100644 --- a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/test/response/SnapshotResponse.java +++ b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/servermock/response/SnapshotResponse.java @@ -1,4 +1,4 @@ -package uk.ac.ic.wlgitbridge.test.response; +package uk.ac.ic.wlgitbridge.snapshot.servermock.response; /** * Created by Winston on 09/01/15. diff --git a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/test/response/SnapshotResponseBuilder.java b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/servermock/response/SnapshotResponseBuilder.java similarity index 75% rename from services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/test/response/SnapshotResponseBuilder.java rename to services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/servermock/response/SnapshotResponseBuilder.java index 2df2035d31..c6b7435b39 100644 --- a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/test/response/SnapshotResponseBuilder.java +++ b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/servermock/response/SnapshotResponseBuilder.java @@ -1,11 +1,11 @@ -package uk.ac.ic.wlgitbridge.test.response; +package uk.ac.ic.wlgitbridge.snapshot.servermock.response; -import uk.ac.ic.wlgitbridge.test.exception.InvalidAPICallException; -import uk.ac.ic.wlgitbridge.test.response.getdoc.SnapshotGetDocResponse; -import uk.ac.ic.wlgitbridge.test.response.getforver.SnapshotGetForVerResponse; -import uk.ac.ic.wlgitbridge.test.response.getsavedver.SnapshotGetSavedVersResponse; -import uk.ac.ic.wlgitbridge.test.response.push.SnapshotPushResponse; -import uk.ac.ic.wlgitbridge.test.state.SnapshotAPIState; +import uk.ac.ic.wlgitbridge.snapshot.servermock.exception.InvalidAPICallException; +import uk.ac.ic.wlgitbridge.snapshot.servermock.response.getdoc.SnapshotGetDocResponse; +import uk.ac.ic.wlgitbridge.snapshot.servermock.response.getforver.SnapshotGetForVerResponse; +import uk.ac.ic.wlgitbridge.snapshot.servermock.response.getsavedver.SnapshotGetSavedVersResponse; +import uk.ac.ic.wlgitbridge.snapshot.servermock.response.push.SnapshotPushResponse; +import uk.ac.ic.wlgitbridge.snapshot.servermock.state.SnapshotAPIState; /** * Created by Winston on 09/01/15. diff --git a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/test/response/getdoc/SnapshotGetDocResponse.java b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/servermock/response/getdoc/SnapshotGetDocResponse.java similarity index 62% rename from services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/test/response/getdoc/SnapshotGetDocResponse.java rename to services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/servermock/response/getdoc/SnapshotGetDocResponse.java index e4115f2b34..7a3e864b3a 100644 --- a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/test/response/getdoc/SnapshotGetDocResponse.java +++ b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/servermock/response/getdoc/SnapshotGetDocResponse.java @@ -1,7 +1,7 @@ -package uk.ac.ic.wlgitbridge.test.response.getdoc; +package uk.ac.ic.wlgitbridge.snapshot.servermock.response.getdoc; -import uk.ac.ic.wlgitbridge.test.response.SnapshotResponse; -import uk.ac.ic.wlgitbridge.writelatex.api.request.getdoc.SnapshotGetDocResult; +import uk.ac.ic.wlgitbridge.snapshot.servermock.response.SnapshotResponse; +import uk.ac.ic.wlgitbridge.snapshot.getdoc.SnapshotGetDocResult; /** * Created by Winston on 09/01/15. diff --git a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/test/response/getforver/SnapshotGetForVerResponse.java b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/servermock/response/getforver/SnapshotGetForVerResponse.java similarity index 62% rename from services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/test/response/getforver/SnapshotGetForVerResponse.java rename to services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/servermock/response/getforver/SnapshotGetForVerResponse.java index 003becb690..8ab750d41c 100644 --- a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/test/response/getforver/SnapshotGetForVerResponse.java +++ b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/servermock/response/getforver/SnapshotGetForVerResponse.java @@ -1,7 +1,7 @@ -package uk.ac.ic.wlgitbridge.test.response.getforver; +package uk.ac.ic.wlgitbridge.snapshot.servermock.response.getforver; -import uk.ac.ic.wlgitbridge.test.response.SnapshotResponse; -import uk.ac.ic.wlgitbridge.writelatex.api.request.getforversion.SnapshotGetForVersionResult; +import uk.ac.ic.wlgitbridge.snapshot.servermock.response.SnapshotResponse; +import uk.ac.ic.wlgitbridge.snapshot.getforversion.SnapshotGetForVersionResult; /** * Created by Winston on 09/01/15. diff --git a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/test/response/getsavedver/SnapshotGetSavedVersResponse.java b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/servermock/response/getsavedver/SnapshotGetSavedVersResponse.java similarity index 62% rename from services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/test/response/getsavedver/SnapshotGetSavedVersResponse.java rename to services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/servermock/response/getsavedver/SnapshotGetSavedVersResponse.java index dd959c1b13..57c6c9f9ec 100644 --- a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/test/response/getsavedver/SnapshotGetSavedVersResponse.java +++ b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/servermock/response/getsavedver/SnapshotGetSavedVersResponse.java @@ -1,7 +1,7 @@ -package uk.ac.ic.wlgitbridge.test.response.getsavedver; +package uk.ac.ic.wlgitbridge.snapshot.servermock.response.getsavedver; -import uk.ac.ic.wlgitbridge.test.response.SnapshotResponse; -import uk.ac.ic.wlgitbridge.writelatex.api.request.getsavedvers.SnapshotGetSavedVersResult; +import uk.ac.ic.wlgitbridge.snapshot.servermock.response.SnapshotResponse; +import uk.ac.ic.wlgitbridge.snapshot.getsavedvers.SnapshotGetSavedVersResult; /** * Created by Winston on 09/01/15. diff --git a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/test/response/push/SnapshotPushResponse.java b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/servermock/response/push/SnapshotPushResponse.java similarity index 69% rename from services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/test/response/push/SnapshotPushResponse.java rename to services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/servermock/response/push/SnapshotPushResponse.java index 12d35fa6e4..20cf296454 100644 --- a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/test/response/push/SnapshotPushResponse.java +++ b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/servermock/response/push/SnapshotPushResponse.java @@ -1,8 +1,8 @@ -package uk.ac.ic.wlgitbridge.test.response.push; +package uk.ac.ic.wlgitbridge.snapshot.servermock.response.push; -import uk.ac.ic.wlgitbridge.test.response.SnapshotResponse; -import uk.ac.ic.wlgitbridge.test.response.push.postback.SnapshotPostbackRequest; -import uk.ac.ic.wlgitbridge.test.response.push.data.SnapshotPushResult; +import uk.ac.ic.wlgitbridge.snapshot.servermock.response.SnapshotResponse; +import uk.ac.ic.wlgitbridge.snapshot.servermock.response.push.postback.SnapshotPostbackRequest; +import uk.ac.ic.wlgitbridge.snapshot.servermock.response.push.data.SnapshotPushResult; /** * Created by Winston on 09/01/15. diff --git a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/test/response/push/data/SnapshotPushResult.java b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/servermock/response/push/data/SnapshotPushResult.java similarity index 91% rename from services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/test/response/push/data/SnapshotPushResult.java rename to services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/servermock/response/push/data/SnapshotPushResult.java index 00b188aa5e..81b6d93c46 100644 --- a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/test/response/push/data/SnapshotPushResult.java +++ b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/servermock/response/push/data/SnapshotPushResult.java @@ -1,4 +1,4 @@ -package uk.ac.ic.wlgitbridge.test.response.push.data; +package uk.ac.ic.wlgitbridge.snapshot.servermock.response.push.data; import com.google.gson.JsonElement; import com.google.gson.JsonObject; diff --git a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/test/response/push/data/SnapshotPushResultOutOfDate.java b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/servermock/response/push/data/SnapshotPushResultOutOfDate.java similarity index 80% rename from services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/test/response/push/data/SnapshotPushResultOutOfDate.java rename to services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/servermock/response/push/data/SnapshotPushResultOutOfDate.java index 561355c3f7..26edb59fb5 100644 --- a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/test/response/push/data/SnapshotPushResultOutOfDate.java +++ b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/servermock/response/push/data/SnapshotPushResultOutOfDate.java @@ -1,4 +1,4 @@ -package uk.ac.ic.wlgitbridge.test.response.push.data; +package uk.ac.ic.wlgitbridge.snapshot.servermock.response.push.data; /** * Created by Winston on 09/01/15. diff --git a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/test/response/push/data/SnapshotPushResultSuccess.java b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/servermock/response/push/data/SnapshotPushResultSuccess.java similarity index 80% rename from services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/test/response/push/data/SnapshotPushResultSuccess.java rename to services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/servermock/response/push/data/SnapshotPushResultSuccess.java index 13db8dd2d4..327dabaa86 100644 --- a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/test/response/push/data/SnapshotPushResultSuccess.java +++ b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/servermock/response/push/data/SnapshotPushResultSuccess.java @@ -1,4 +1,4 @@ -package uk.ac.ic.wlgitbridge.test.response.push.data; +package uk.ac.ic.wlgitbridge.snapshot.servermock.response.push.data; /** * Created by Winston on 09/01/15. diff --git a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/test/response/push/postback/SnapshotPostbackRequest.java b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/servermock/response/push/postback/SnapshotPostbackRequest.java similarity index 84% rename from services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/test/response/push/postback/SnapshotPostbackRequest.java rename to services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/servermock/response/push/postback/SnapshotPostbackRequest.java index 49992d3aff..9799f8f4f0 100644 --- a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/test/response/push/postback/SnapshotPostbackRequest.java +++ b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/servermock/response/push/postback/SnapshotPostbackRequest.java @@ -1,4 +1,4 @@ -package uk.ac.ic.wlgitbridge.test.response.push.postback; +package uk.ac.ic.wlgitbridge.snapshot.servermock.response.push.postback; import com.google.gson.JsonObject; diff --git a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/test/response/push/postback/SnapshotPostbackRequestError.java b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/servermock/response/push/postback/SnapshotPostbackRequestError.java similarity index 85% rename from services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/test/response/push/postback/SnapshotPostbackRequestError.java rename to services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/servermock/response/push/postback/SnapshotPostbackRequestError.java index 01801c31e6..2d68fafa33 100644 --- a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/test/response/push/postback/SnapshotPostbackRequestError.java +++ b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/servermock/response/push/postback/SnapshotPostbackRequestError.java @@ -1,4 +1,4 @@ -package uk.ac.ic.wlgitbridge.test.response.push.postback; +package uk.ac.ic.wlgitbridge.snapshot.servermock.response.push.postback; import com.google.gson.JsonObject; diff --git a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/test/response/push/postback/SnapshotPostbackRequestInvalidFiles.java b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/servermock/response/push/postback/SnapshotPostbackRequestInvalidFiles.java similarity index 80% rename from services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/test/response/push/postback/SnapshotPostbackRequestInvalidFiles.java rename to services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/servermock/response/push/postback/SnapshotPostbackRequestInvalidFiles.java index 91c900f003..f0b1ba9b06 100644 --- a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/test/response/push/postback/SnapshotPostbackRequestInvalidFiles.java +++ b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/servermock/response/push/postback/SnapshotPostbackRequestInvalidFiles.java @@ -1,8 +1,8 @@ -package uk.ac.ic.wlgitbridge.test.response.push.postback; +package uk.ac.ic.wlgitbridge.snapshot.servermock.response.push.postback; import com.google.gson.JsonArray; import com.google.gson.JsonObject; -import uk.ac.ic.wlgitbridge.test.response.push.postback.invalidfile.InvalidFileError; +import uk.ac.ic.wlgitbridge.snapshot.servermock.response.push.postback.invalidfile.InvalidFileError; import java.util.List; diff --git a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/test/response/push/postback/SnapshotPostbackRequestInvalidProject.java b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/servermock/response/push/postback/SnapshotPostbackRequestInvalidProject.java similarity index 92% rename from services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/test/response/push/postback/SnapshotPostbackRequestInvalidProject.java rename to services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/servermock/response/push/postback/SnapshotPostbackRequestInvalidProject.java index e60368cf16..82cb71fb84 100644 --- a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/test/response/push/postback/SnapshotPostbackRequestInvalidProject.java +++ b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/servermock/response/push/postback/SnapshotPostbackRequestInvalidProject.java @@ -1,4 +1,4 @@ -package uk.ac.ic.wlgitbridge.test.response.push.postback; +package uk.ac.ic.wlgitbridge.snapshot.servermock.response.push.postback; import com.google.gson.JsonArray; import com.google.gson.JsonObject; diff --git a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/test/response/push/postback/SnapshotPostbackRequestOutOfDate.java b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/servermock/response/push/postback/SnapshotPostbackRequestOutOfDate.java similarity index 85% rename from services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/test/response/push/postback/SnapshotPostbackRequestOutOfDate.java rename to services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/servermock/response/push/postback/SnapshotPostbackRequestOutOfDate.java index e01645ccd6..def04e92b1 100644 --- a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/test/response/push/postback/SnapshotPostbackRequestOutOfDate.java +++ b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/servermock/response/push/postback/SnapshotPostbackRequestOutOfDate.java @@ -1,4 +1,4 @@ -package uk.ac.ic.wlgitbridge.test.response.push.postback; +package uk.ac.ic.wlgitbridge.snapshot.servermock.response.push.postback; import com.google.gson.JsonObject; diff --git a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/test/response/push/postback/SnapshotPostbackRequestSuccess.java b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/servermock/response/push/postback/SnapshotPostbackRequestSuccess.java similarity index 87% rename from services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/test/response/push/postback/SnapshotPostbackRequestSuccess.java rename to services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/servermock/response/push/postback/SnapshotPostbackRequestSuccess.java index 28a887ab40..07dba7e5fd 100644 --- a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/test/response/push/postback/SnapshotPostbackRequestSuccess.java +++ b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/servermock/response/push/postback/SnapshotPostbackRequestSuccess.java @@ -1,4 +1,4 @@ -package uk.ac.ic.wlgitbridge.test.response.push.postback; +package uk.ac.ic.wlgitbridge.snapshot.servermock.response.push.postback; import com.google.gson.JsonObject; diff --git a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/test/response/push/postback/invalidfile/InvalidFileError.java b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/servermock/response/push/postback/invalidfile/InvalidFileError.java similarity index 85% rename from services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/test/response/push/postback/invalidfile/InvalidFileError.java rename to services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/servermock/response/push/postback/invalidfile/InvalidFileError.java index f8c79bbd71..ab7c52cb4f 100644 --- a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/test/response/push/postback/invalidfile/InvalidFileError.java +++ b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/servermock/response/push/postback/invalidfile/InvalidFileError.java @@ -1,4 +1,4 @@ -package uk.ac.ic.wlgitbridge.test.response.push.postback.invalidfile; +package uk.ac.ic.wlgitbridge.snapshot.servermock.response.push.postback.invalidfile; import com.google.gson.JsonObject; diff --git a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/test/response/push/postback/invalidfile/InvalidFileErrorDefault.java b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/servermock/response/push/postback/invalidfile/InvalidFileErrorDefault.java similarity index 75% rename from services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/test/response/push/postback/invalidfile/InvalidFileErrorDefault.java rename to services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/servermock/response/push/postback/invalidfile/InvalidFileErrorDefault.java index 038d98cbd2..85fc037088 100644 --- a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/test/response/push/postback/invalidfile/InvalidFileErrorDefault.java +++ b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/servermock/response/push/postback/invalidfile/InvalidFileErrorDefault.java @@ -1,4 +1,4 @@ -package uk.ac.ic.wlgitbridge.test.response.push.postback.invalidfile; +package uk.ac.ic.wlgitbridge.snapshot.servermock.response.push.postback.invalidfile; /** * Created by Winston on 09/01/15. diff --git a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/test/response/push/postback/invalidfile/InvalidFileErrorDisallowed.java b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/servermock/response/push/postback/invalidfile/InvalidFileErrorDisallowed.java similarity index 76% rename from services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/test/response/push/postback/invalidfile/InvalidFileErrorDisallowed.java rename to services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/servermock/response/push/postback/invalidfile/InvalidFileErrorDisallowed.java index bb30f550ef..159f80406c 100644 --- a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/test/response/push/postback/invalidfile/InvalidFileErrorDisallowed.java +++ b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/servermock/response/push/postback/invalidfile/InvalidFileErrorDisallowed.java @@ -1,4 +1,4 @@ -package uk.ac.ic.wlgitbridge.test.response.push.postback.invalidfile; +package uk.ac.ic.wlgitbridge.snapshot.servermock.response.push.postback.invalidfile; /** * Created by Winston on 09/01/15. diff --git a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/test/response/push/postback/invalidfile/InvalidFileErrorUnclean.java b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/servermock/response/push/postback/invalidfile/InvalidFileErrorUnclean.java similarity index 87% rename from services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/test/response/push/postback/invalidfile/InvalidFileErrorUnclean.java rename to services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/servermock/response/push/postback/invalidfile/InvalidFileErrorUnclean.java index 694bc882e2..746dc766a2 100644 --- a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/test/response/push/postback/invalidfile/InvalidFileErrorUnclean.java +++ b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/servermock/response/push/postback/invalidfile/InvalidFileErrorUnclean.java @@ -1,4 +1,4 @@ -package uk.ac.ic.wlgitbridge.test.response.push.postback.invalidfile; +package uk.ac.ic.wlgitbridge.snapshot.servermock.response.push.postback.invalidfile; import com.google.gson.JsonObject; diff --git a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/test/server/MockSnapshotRequestHandler.java b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/servermock/server/MockSnapshotRequestHandler.java similarity index 82% rename from services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/test/server/MockSnapshotRequestHandler.java rename to services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/servermock/server/MockSnapshotRequestHandler.java index 9d7ed95da3..3babeea283 100644 --- a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/test/server/MockSnapshotRequestHandler.java +++ b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/servermock/server/MockSnapshotRequestHandler.java @@ -1,10 +1,10 @@ -package uk.ac.ic.wlgitbridge.test.server; +package uk.ac.ic.wlgitbridge.snapshot.servermock.server; import org.eclipse.jetty.server.Request; import org.eclipse.jetty.server.handler.AbstractHandler; -import uk.ac.ic.wlgitbridge.test.exception.InvalidAPICallException; -import uk.ac.ic.wlgitbridge.test.response.SnapshotResponse; -import uk.ac.ic.wlgitbridge.test.response.SnapshotResponseBuilder; +import uk.ac.ic.wlgitbridge.snapshot.servermock.exception.InvalidAPICallException; +import uk.ac.ic.wlgitbridge.snapshot.servermock.response.SnapshotResponse; +import uk.ac.ic.wlgitbridge.snapshot.servermock.response.SnapshotResponseBuilder; import uk.ac.ic.wlgitbridge.util.Util; import javax.servlet.ServletException; diff --git a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/test/server/MockSnapshotServer.java b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/servermock/server/MockSnapshotServer.java similarity index 88% rename from services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/test/server/MockSnapshotServer.java rename to services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/servermock/server/MockSnapshotServer.java index 59ee4ab4ab..e7e80e3973 100644 --- a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/test/server/MockSnapshotServer.java +++ b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/servermock/server/MockSnapshotServer.java @@ -1,11 +1,11 @@ -package uk.ac.ic.wlgitbridge.test.server; +package uk.ac.ic.wlgitbridge.snapshot.servermock.server; import org.eclipse.jetty.server.NetworkConnector; import org.eclipse.jetty.server.Server; import org.eclipse.jetty.server.handler.HandlerCollection; import org.eclipse.jetty.server.handler.ResourceHandler; -import uk.ac.ic.wlgitbridge.test.response.SnapshotResponseBuilder; -import uk.ac.ic.wlgitbridge.test.state.SnapshotAPIState; +import uk.ac.ic.wlgitbridge.snapshot.servermock.response.SnapshotResponseBuilder; +import uk.ac.ic.wlgitbridge.snapshot.servermock.state.SnapshotAPIState; import uk.ac.ic.wlgitbridge.util.Util; import java.io.File; diff --git a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/test/server/PostbackThread.java b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/servermock/server/PostbackThread.java similarity index 95% rename from services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/test/server/PostbackThread.java rename to services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/servermock/server/PostbackThread.java index 48f72cb5dc..07716c12b6 100644 --- a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/test/server/PostbackThread.java +++ b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/servermock/server/PostbackThread.java @@ -1,4 +1,4 @@ -package uk.ac.ic.wlgitbridge.test.server; +package uk.ac.ic.wlgitbridge.snapshot.servermock.server; import com.google.gson.Gson; import com.google.gson.JsonObject; diff --git a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/test/state/SnapshotAPIState.java b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/servermock/state/SnapshotAPIState.java similarity index 68% rename from services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/test/state/SnapshotAPIState.java rename to services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/servermock/state/SnapshotAPIState.java index 7087b6b34f..5339043d97 100644 --- a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/test/state/SnapshotAPIState.java +++ b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/servermock/state/SnapshotAPIState.java @@ -1,16 +1,16 @@ -package uk.ac.ic.wlgitbridge.test.state; +package uk.ac.ic.wlgitbridge.snapshot.servermock.state; -import uk.ac.ic.wlgitbridge.test.response.push.data.SnapshotPushResult; -import uk.ac.ic.wlgitbridge.test.response.push.data.SnapshotPushResultSuccess; -import uk.ac.ic.wlgitbridge.test.response.push.postback.SnapshotPostbackRequest; -import uk.ac.ic.wlgitbridge.test.response.push.postback.SnapshotPostbackRequestInvalidProject; -import uk.ac.ic.wlgitbridge.writelatex.api.request.getdoc.SnapshotGetDocResult; -import uk.ac.ic.wlgitbridge.writelatex.api.request.getforversion.SnapshotAttachment; -import uk.ac.ic.wlgitbridge.writelatex.api.request.getforversion.SnapshotData; -import uk.ac.ic.wlgitbridge.writelatex.api.request.getforversion.SnapshotFile; -import uk.ac.ic.wlgitbridge.writelatex.api.request.getforversion.SnapshotGetForVersionResult; -import uk.ac.ic.wlgitbridge.writelatex.api.request.getsavedvers.SnapshotGetSavedVersResult; -import uk.ac.ic.wlgitbridge.writelatex.api.request.getsavedvers.SnapshotInfo; +import uk.ac.ic.wlgitbridge.snapshot.servermock.response.push.data.SnapshotPushResult; +import uk.ac.ic.wlgitbridge.snapshot.servermock.response.push.data.SnapshotPushResultSuccess; +import uk.ac.ic.wlgitbridge.snapshot.servermock.response.push.postback.SnapshotPostbackRequest; +import uk.ac.ic.wlgitbridge.snapshot.servermock.response.push.postback.SnapshotPostbackRequestInvalidProject; +import uk.ac.ic.wlgitbridge.snapshot.getdoc.SnapshotGetDocResult; +import uk.ac.ic.wlgitbridge.snapshot.getforversion.SnapshotAttachment; +import uk.ac.ic.wlgitbridge.snapshot.getforversion.SnapshotData; +import uk.ac.ic.wlgitbridge.snapshot.getforversion.SnapshotFile; +import uk.ac.ic.wlgitbridge.snapshot.getforversion.SnapshotGetForVersionResult; +import uk.ac.ic.wlgitbridge.snapshot.getsavedvers.SnapshotGetSavedVersResult; +import uk.ac.ic.wlgitbridge.snapshot.getsavedvers.SnapshotInfo; import java.util.*; @@ -57,43 +57,43 @@ public class SnapshotAPIState { getForVers = new HashMap>() {{ put("1826rqgsdb", new HashMap() {{ put(243, new SnapshotGetForVersionResult(new SnapshotData(Arrays.asList( - new SnapshotFile("\\\\documentclass[a4paper]{article}\\n\\n\\\\usepackage[english]{babel}\\n\\\\usepackage[utf8]{inputenc}\\n\\\\usepackage{graphicx}\\n\\\\usepackage{fullpage}\\n\\\\usepackage{listings}\\n\\\\usepackage{courier}\\n\\\\usepackage{url}\\n\\n\\\\lstset{basicstyle=\\\\ttfamily,breaklines=true}\\n\\n\\\\begin{document}\\n\\\\title{API for the writeLaTeX-Git Bridge}\\n\\\\author{JLM}\\n\\\\date{\\\\today}\\n\\\\maketitle\\n\\n\\\\section{Fetching a Project from WriteLaTeX}\\n\\nThere are three API calls that will likely be of interest. You can run them against this server, \\\\url{radiant-wind-3058.herokuapp.com}, but they're not on the production server yet.\\n\\n\\\\subsection{Get Doc}\\n\\nA ``doc'' is our internal term for a ``project''. This endpoint returns the latest version id, when the latest version was created (ISO8601), and the user that last edited the project (if any, otherwise null).\\n\\n\\\\begin{lstlisting}\\nGET https://.../api/v0/docs/1826rqgsdb\\n# => {\\n \\\"latestVerId\\\": 39,\\n \\\"latestVerAt\\\": \\\"2014-11-30T18:35:27Z\\\",\\n \\\"latestVerBy\\\": {\\n \\\"email\\\": \\\"jdleesmiller@gmail.com\\\",\\n \\\"name\\\": \\\"John Lees-Miller\\\"\\n }}\\n\\\\end{lstlisting}\\n\\n\\\\subsection{Get Saved Vers}\\n\\nA ``saved ver'' is a version of a doc, saved by via the versions menu. Note that this query is not currently paginated.\\n\\n\\\\begin{lstlisting}\\nGET https://.../api/v0/docs/1826rqgsdb/saved_vers\\n# => [\\n {\\\"versionId\\\":39,\\n \\\"comment\\\":\\\"with more files\\\",\\n \\\"user\\\":{\\n \\\"email\\\":\\\"jdleesmiller@gmail.com\\\",\\n \\\"name\\\":\\\"John Lees-Miller\\\"},\\n \\\"createdAt\\\":\\\"2014-11-05T18:02:19Z\\\"},\\n {\\\"versionId\\\":24,\\n \\\"comment\\\":\\\"first draft\\\",\\n \\\"user\\\":{\\n \\\"email\\\":\\\"jdleesmiller@gmail.com\\\",\\n \\\"name\\\":\\\"John Lees-Miller\\\"},\\n \\\"createdAt\\\":\\\"2014-11-05T17:56:58Z\\\"}]\\n\\\\end{lstlisting}\\n\\n\\\\subsection{Get Snapshot for Version}\\n\\nA snapshot contains the content of a project in the given version. You can safely request a snapshot of any version that is, or was at any point in the last 24 hours, (1) a saved version, or (2) the current version. (Older versions may or may not have been moved to cold storage.)\\n\\nThe srcs array contains (content, file name) pairs; the atts array contains (URL, file name) pairs.\\n\\n\\\\begin{lstlisting}\\nGET https://.../api/v0/docs/1826rqgsdb/snapshots/39\\n# => {\\n \\\"srcs\\\":[\\n [\\\"This text is from another file.\\\",\\\"foo/bar/test.tex\\\"],\\n [\\\"\\\\\\\\documentclass[a4paper]{article}\\\\n...\\\",\\\"main.tex\\\"]],\\n \\\"atts\\\":[\\n [\\\"https://writelatex-staging.s3.amazonaws.com/filepicker/1ENnu6zJSGyslI3DuNZD_min_mean_wait_evm_7.eps.150dpi.png\\\",\\\"min_mean_wait_evm_7_eps_150dpi.png\\\"]]}\\n\\\\end{lstlisting}\\n\\n\\\\section{Pushing a Project to WriteLaTeX}\\n\\n\\\\subsection{Push a Project}\\n\\n\\\\begin{lstlisting}\\n# NB: JLM originally said PUT, but he now thinks POST is better\\n# NB: you must set a Content-Type: application/json header for this request\\n# in order to specify the data as JSON in the request body\\nPOST https://.../api/v0/docs/1826rqgsdb/snapshots\\nData:\\n{\\n latestVerId: integer,\\n files: [\\n {\\n name: string path (forward slashes, relative to root)\\n url: string (but only if the file is modified; else no url given)\\n }, ...\\n ]\\n postbackUrl: url to post result back to\\n}\\nResponse on success:\\n{\\n status: 202,\\n code: \\\"accepted\\\",\\n message: \\\"Accepted\\\"\\n}\\nResponse on out of date:\\n{\\n status: 409, # Conflict\\n code: \\\"outOfDate\\\",\\n message: \\\"Out of Date\\\"\\n}\\n\\nPostback Data (METHOD POST):\\nOn success:\\n{\\n code: \\\"upToDate\\\",\\n latestVerId: integer\\n}\\nOn out of date:\\n{\\n code: \\\"outOfDate\\\",\\n message: \\\"Out of Date\\\"\\n}\\nOn error with the files list (e.g. file extension not allowed):\\n{\\n code: \\\"invalidFiles\\\",\\n errors: [ {\\n file: the file name from the snapshot,\\n state: \\\"error\\\"|\\\"disallowed\\\"|\\\"unclean_name\\\"\\n }, ... ]\\n}\\nIf the file's error state is unclean_name, the error object will alsocontain a property cleanFile that contains the name of the file after it has been \\\"cleaned\\\" to meet our file naming requirements; for other file error states, this property is not present.\\nOn error with the project as a whole (e.g. over quota):\\n{\\n code: \\\"invalidProject\\\",\\n message: short string message for debugging\\n errors: [ array of zero or more string messages for the user ]\\n}\\nOn unexpected error (bug):\\n{\\n code: \\\"error\\\",\\n message: \\\"Unexpected Error\\\"\\n}\\n\\\\end{lstlisting}\\n\\n\\\\section{Test Data}\\n\\nYou can use this project as one of your test projects. I've added an attachment and a file in a subfolder to make it a bit more interesting.\\n\\n\\\\input{foo/bar/test}\\n\\n\\\\includegraphics[width=\\\\linewidth]{min_mean_wait_evm_7_eps_150dpi}\\n\\n\\\\end{document}", "main.tex"), - new SnapshotFile("This text is from another file.", "foo/bar/test.tex") + new SnapshotFile("\\\\documentclass[a4paper]{article}\\n\\n\\\\usepackage[english]{babel}\\n\\\\usepackage[utf8]{inputenc}\\n\\\\usepackage{graphicx}\\n\\\\usepackage{fullpage}\\n\\\\usepackage{listings}\\n\\\\usepackage{courier}\\n\\\\usepackage{url}\\n\\n\\\\lstset{basicstyle=\\\\ttfamily,breaklines=true}\\n\\n\\\\begin{document}\\n\\\\title{API for the writeLaTeX-Git Bridge}\\n\\\\author{JLM}\\n\\\\date{\\\\today}\\n\\\\maketitle\\n\\n\\\\section{Fetching a Project from WriteLaTeX}\\n\\nThere are three API calls that will likely be of interest. You can run them against this server, \\\\url{radiant-wind-3058.herokuapp.com}, but they're not on the production server yet.\\n\\n\\\\subsection{Get Doc}\\n\\nA ``doc'' is our internal term for a ``project''. This endpoint returns the latest version id, when the latest version was created (ISO8601), and the user that last edited the project (if any, otherwise null).\\n\\n\\\\begin{lstlisting}\\nGET https://.../api/v0/docs/1826rqgsdb\\n# => {\\n \\\"latestVerId\\\": 39,\\n \\\"latestVerAt\\\": \\\"2014-11-30T18:35:27Z\\\",\\n \\\"latestVerBy\\\": {\\n \\\"email\\\": \\\"jdleesmiller@gmail.com\\\",\\n \\\"name\\\": \\\"John Lees-Miller\\\"\\n }}\\n\\\\end{lstlisting}\\n\\n\\\\subsection{Get Saved Vers}\\n\\nA ``saved ver'' is a version of a doc, saved by via the versions menu. Note that this query is not currently paginated.\\n\\n\\\\begin{lstlisting}\\nGET https://.../api/v0/docs/1826rqgsdb/saved_vers\\n# => [\\n {\\\"versionId\\\":39,\\n \\\"comment\\\":\\\"with more files\\\",\\n \\\"user\\\":{\\n \\\"email\\\":\\\"jdleesmiller@gmail.com\\\",\\n \\\"name\\\":\\\"John Lees-Miller\\\"},\\n \\\"createdAt\\\":\\\"2014-11-05T18:02:19Z\\\"},\\n {\\\"versionId\\\":24,\\n \\\"comment\\\":\\\"first draft\\\",\\n \\\"user\\\":{\\n \\\"email\\\":\\\"jdleesmiller@gmail.com\\\",\\n \\\"name\\\":\\\"John Lees-Miller\\\"},\\n \\\"createdAt\\\":\\\"2014-11-05T17:56:58Z\\\"}]\\n\\\\end{lstlisting}\\n\\n\\\\subsection{Get Snapshot for Version}\\n\\nA snapshot contains the content of a project in the given version. You can safely request a snapshot of any version that is, or was at any point in the last 24 hours, (1) a saved version, or (2) the current version. (Older versions may or may not have been moved to cold storage.)\\n\\nThe srcs array contains (content, file name) pairs; the atts array contains (URL, file name) pairs.\\n\\n\\\\begin{lstlisting}\\nGET https://.../api/v0/docs/1826rqgsdb/snapshots/39\\n# => {\\n \\\"srcs\\\":[\\n [\\\"This text is from another file.\\\",\\\"foo/bar/servermock.tex\\\"],\\n [\\\"\\\\\\\\documentclass[a4paper]{article}\\\\n...\\\",\\\"main.tex\\\"]],\\n \\\"atts\\\":[\\n [\\\"https://writelatex-staging.s3.amazonaws.com/filepicker/1ENnu6zJSGyslI3DuNZD_min_mean_wait_evm_7.eps.150dpi.png\\\",\\\"min_mean_wait_evm_7_eps_150dpi.png\\\"]]}\\n\\\\end{lstlisting}\\n\\n\\\\section{Pushing a Project to WriteLaTeX}\\n\\n\\\\subsection{Push a Project}\\n\\n\\\\begin{lstlisting}\\n# NB: JLM originally said PUT, but he now thinks POST is better\\n# NB: you must set a Content-Type: application/json header for this request\\n# in order to specify the data as JSON in the request body\\nPOST https://.../api/v0/docs/1826rqgsdb/snapshots\\nData:\\n{\\n latestVerId: integer,\\n files: [\\n {\\n name: string path (forward slashes, relative to root)\\n url: string (but only if the file is modified; else no url given)\\n }, ...\\n ]\\n postbackUrl: url to post result back to\\n}\\nResponse on success:\\n{\\n status: 202,\\n code: \\\"accepted\\\",\\n message: \\\"Accepted\\\"\\n}\\nResponse on out of date:\\n{\\n status: 409, # Conflict\\n code: \\\"outOfDate\\\",\\n message: \\\"Out of Date\\\"\\n}\\n\\nPostback Data (METHOD POST):\\nOn success:\\n{\\n code: \\\"upToDate\\\",\\n latestVerId: integer\\n}\\nOn out of date:\\n{\\n code: \\\"outOfDate\\\",\\n message: \\\"Out of Date\\\"\\n}\\nOn error with the files list (e.g. file extension not allowed):\\n{\\n code: \\\"invalidFiles\\\",\\n errors: [ {\\n file: the file name from the snapshot,\\n state: \\\"error\\\"|\\\"disallowed\\\"|\\\"unclean_name\\\"\\n }, ... ]\\n}\\nIf the file's error state is unclean_name, the error object will alsocontain a property cleanFile that contains the name of the file after it has been \\\"cleaned\\\" to meet our file naming requirements; for other file error states, this property is not present.\\nOn error with the project as a whole (e.g. over quota):\\n{\\n code: \\\"invalidProject\\\",\\n message: short string message for debugging\\n errors: [ array of zero or more string messages for the user ]\\n}\\nOn unexpected error (bug):\\n{\\n code: \\\"error\\\",\\n message: \\\"Unexpected Error\\\"\\n}\\n\\\\end{lstlisting}\\n\\n\\\\section{Test Data}\\n\\nYou can use this project as one of your servermock projects. I've added an attachment and a file in a subfolder to make it a bit more interesting.\\n\\n\\\\input{foo/bar/servermock}\\n\\n\\\\includegraphics[width=\\\\linewidth]{min_mean_wait_evm_7_eps_150dpi}\\n\\n\\\\end{document}", "main.tex"), + new SnapshotFile("This text is from another file.", "foo/bar/servermock.tex") ), Arrays.asList( new SnapshotAttachment("https://writelatex-staging.s3.amazonaws.com/filepicker/1ENnu6zJSGyslI3DuNZD_min_mean_wait_evm_7.eps.150dpi.png", "min_mean_wait_evm_7_eps_150dpi.png") )))); put(185, new SnapshotGetForVersionResult(new SnapshotData(Arrays.asList( - new SnapshotFile("\\\\documentclass[a4paper]{article}\\n\\n\\\\usepackage[english]{babel}\\n\\\\usepackage[utf8]{inputenc}\\n\\\\usepackage{graphicx}\\n\\\\usepackage{fullpage}\\n\\\\usepackage{listings}\\n\\\\usepackage{courier}\\n\\\\usepackage{url}\\n\\n\\\\lstset{basicstyle=\\\\ttfamily,breaklines=true}\\n\\n\\\\begin{document}\\n\\\\title{API for the writeLaTeX-Git Bridge}\\n\\\\author{JLM}\\n\\\\date{\\\\today}\\n\\\\maketitle\\n\\n\\\\section{Fetching a Project from WriteLaTeX}\\n\\nThere are three API calls that will likely be of interest. You can run them against this server, \\\\url{radiant-wind-3058.herokuapp.com}, but they're not on the production server yet.\\n\\n\\\\subsection{Get Doc}\\n\\nA ``doc'' is our internal term for a ``project''. At present, this just returns the latest version number.\\n\\n\\\\begin{lstlisting}\\nGET https://.../api/v0/docs/1826rqgsdb\\n# => { latestVerId: 39 }\\nTODO will also include updatedAt time and user (if it was not anonymous)\\n\\\\end{lstlisting}\\n\\n\\\\subsection{Get Saved Vers}\\n\\nA ``saved ver'' is a version of a doc, saved by via the versions menu. Note that this query is not currently paginated.\\n\\n\\\\begin{lstlisting}\\nGET https://.../api/v0/docs/1826rqgsdb/saved_vers\\n# => [\\n {\\\"versionId\\\":39,\\n \\\"comment\\\":\\\"with more files\\\",\\n \\\"user\\\":{\\n \\\"email\\\":\\\"jdleesmiller@gmail.com\\\",\\n \\\"name\\\":\\\"John Lees-Miller\\\"},\\n \\\"createdAt\\\":\\\"2014-11-05T18:02:19Z\\\"},\\n {\\\"versionId\\\":24,\\n \\\"comment\\\":\\\"first draft\\\",\\n \\\"user\\\":{\\n \\\"email\\\":\\\"jdleesmiller@gmail.com\\\",\\n \\\"name\\\":\\\"John Lees-Miller\\\"},\\n \\\"createdAt\\\":\\\"2014-11-05T17:56:58Z\\\"}]\\n\\\\end{lstlisting}\\n\\n\\\\subsection{Get Snapshot for Version}\\n\\nA snapshot contains the content of a project in the given version. You can safely request a snapshot of any version that is, or was at any point in the last 24 hours, (1) a saved version, or (2) the current version. (Older versions may or may not have been moved to cold storage.)\\n\\nThe srcs array contains (content, file name) pairs; the atts array contains (URL, file name) pairs.\\n\\n\\\\begin{lstlisting}\\nGET https://.../api/v0/docs/1826rqgsdb/snapshots/39\\n# => {\\n \\\"srcs\\\":[\\n [\\\"This text is from another file.\\\",\\\"foo/bar/test.tex\\\"],\\n [\\\"\\\\\\\\documentclass[a4paper]{article}\\\\n...\\\",\\\"main.tex\\\"]],\\n \\\"atts\\\":[\\n [\\\"https://writelatex-staging.s3.amazonaws.com/filepicker/1ENnu6zJSGyslI3DuNZD_min_mean_wait_evm_7.eps.150dpi.png\\\",\\\"min_mean_wait_evm_7_eps_150dpi.png\\\"]]}\\n\\\\end{lstlisting}\\n\\n\\\\section{Pushing a Project to WriteLaTeX}\\n\\n\\\\subsection{Push a Project}\\n\\n\\\\begin{lstlisting}\\n# NB: JLM originally said PUT, but he now thinks POST is better\\n# NB: you must set a Content-Type: application/json header for this request\\n# in order to specify the data as JSON in the request body\\nPOST https://.../api/v0/docs/1826rqgsdb/snapshots\\nData:\\n{\\n latestVerId: integer,\\n files: [\\n {\\n name: string path (forward slashes, relative to root)\\n url: string (but only if the file is modified; else no url given)\\n }, ...\\n ]\\n postbackUrl: url to post result back to\\n}\\nResponse on success:\\n{\\n status: 202,\\n code: \\\"accepted\\\",\\n message: \\\"Accepted\\\"\\n}\\nResponse on out of date:\\n{\\n status: 409, # Conflict\\n code: \\\"outOfDate\\\",\\n message: \\\"Out of Date\\\"\\n}\\n\\nPostback Data (METHOD POST):\\nOn success:\\n{\\n code: \\\"upToDate\\\",\\n latestVerId: integer\\n}\\nOn out of date:\\n{\\n code: \\\"outOfDate\\\",\\n message: \\\"Out of Date\\\"\\n}\\nOn error with the files list (e.g. file extension not allowed):\\n{\\n code: \\\"invalidFiles\\\",\\n errors: TODO\\n}\\nOn error with the project as a whole (e.g. over quota):\\n{\\n code: \\\"invalidProject\\\",\\n errors: TODO\\n}\\nOn unexpected error (bug):\\n{\\n code: \\\"error\\\",\\n message: \\\"Unexpected Error\\\"\\n}\\n\\\\end{lstlisting}\\n\\n\\\\section{Test Data}\\n\\nYou can use this project as one of your test projects. I've added an attachment and a file in a subfolder to make it a bit more interesting.\\n\\n\\\\input{foo/bar/test}\\n\\n\\\\includegraphics[width=\\\\linewidth]{min_mean_wait_evm_7_eps_150dpi}\\n\\n\\\\end{document}", "main.tex"), - new SnapshotFile("This text is from another file.", "foo/bar/test.tex") + new SnapshotFile("\\\\documentclass[a4paper]{article}\\n\\n\\\\usepackage[english]{babel}\\n\\\\usepackage[utf8]{inputenc}\\n\\\\usepackage{graphicx}\\n\\\\usepackage{fullpage}\\n\\\\usepackage{listings}\\n\\\\usepackage{courier}\\n\\\\usepackage{url}\\n\\n\\\\lstset{basicstyle=\\\\ttfamily,breaklines=true}\\n\\n\\\\begin{document}\\n\\\\title{API for the writeLaTeX-Git Bridge}\\n\\\\author{JLM}\\n\\\\date{\\\\today}\\n\\\\maketitle\\n\\n\\\\section{Fetching a Project from WriteLaTeX}\\n\\nThere are three API calls that will likely be of interest. You can run them against this server, \\\\url{radiant-wind-3058.herokuapp.com}, but they're not on the production server yet.\\n\\n\\\\subsection{Get Doc}\\n\\nA ``doc'' is our internal term for a ``project''. At present, this just returns the latest version number.\\n\\n\\\\begin{lstlisting}\\nGET https://.../api/v0/docs/1826rqgsdb\\n# => { latestVerId: 39 }\\nTODO will also include updatedAt time and user (if it was not anonymous)\\n\\\\end{lstlisting}\\n\\n\\\\subsection{Get Saved Vers}\\n\\nA ``saved ver'' is a version of a doc, saved by via the versions menu. Note that this query is not currently paginated.\\n\\n\\\\begin{lstlisting}\\nGET https://.../api/v0/docs/1826rqgsdb/saved_vers\\n# => [\\n {\\\"versionId\\\":39,\\n \\\"comment\\\":\\\"with more files\\\",\\n \\\"user\\\":{\\n \\\"email\\\":\\\"jdleesmiller@gmail.com\\\",\\n \\\"name\\\":\\\"John Lees-Miller\\\"},\\n \\\"createdAt\\\":\\\"2014-11-05T18:02:19Z\\\"},\\n {\\\"versionId\\\":24,\\n \\\"comment\\\":\\\"first draft\\\",\\n \\\"user\\\":{\\n \\\"email\\\":\\\"jdleesmiller@gmail.com\\\",\\n \\\"name\\\":\\\"John Lees-Miller\\\"},\\n \\\"createdAt\\\":\\\"2014-11-05T17:56:58Z\\\"}]\\n\\\\end{lstlisting}\\n\\n\\\\subsection{Get Snapshot for Version}\\n\\nA snapshot contains the content of a project in the given version. You can safely request a snapshot of any version that is, or was at any point in the last 24 hours, (1) a saved version, or (2) the current version. (Older versions may or may not have been moved to cold storage.)\\n\\nThe srcs array contains (content, file name) pairs; the atts array contains (URL, file name) pairs.\\n\\n\\\\begin{lstlisting}\\nGET https://.../api/v0/docs/1826rqgsdb/snapshots/39\\n# => {\\n \\\"srcs\\\":[\\n [\\\"This text is from another file.\\\",\\\"foo/bar/servermock.tex\\\"],\\n [\\\"\\\\\\\\documentclass[a4paper]{article}\\\\n...\\\",\\\"main.tex\\\"]],\\n \\\"atts\\\":[\\n [\\\"https://writelatex-staging.s3.amazonaws.com/filepicker/1ENnu6zJSGyslI3DuNZD_min_mean_wait_evm_7.eps.150dpi.png\\\",\\\"min_mean_wait_evm_7_eps_150dpi.png\\\"]]}\\n\\\\end{lstlisting}\\n\\n\\\\section{Pushing a Project to WriteLaTeX}\\n\\n\\\\subsection{Push a Project}\\n\\n\\\\begin{lstlisting}\\n# NB: JLM originally said PUT, but he now thinks POST is better\\n# NB: you must set a Content-Type: application/json header for this request\\n# in order to specify the data as JSON in the request body\\nPOST https://.../api/v0/docs/1826rqgsdb/snapshots\\nData:\\n{\\n latestVerId: integer,\\n files: [\\n {\\n name: string path (forward slashes, relative to root)\\n url: string (but only if the file is modified; else no url given)\\n }, ...\\n ]\\n postbackUrl: url to post result back to\\n}\\nResponse on success:\\n{\\n status: 202,\\n code: \\\"accepted\\\",\\n message: \\\"Accepted\\\"\\n}\\nResponse on out of date:\\n{\\n status: 409, # Conflict\\n code: \\\"outOfDate\\\",\\n message: \\\"Out of Date\\\"\\n}\\n\\nPostback Data (METHOD POST):\\nOn success:\\n{\\n code: \\\"upToDate\\\",\\n latestVerId: integer\\n}\\nOn out of date:\\n{\\n code: \\\"outOfDate\\\",\\n message: \\\"Out of Date\\\"\\n}\\nOn error with the files list (e.g. file extension not allowed):\\n{\\n code: \\\"invalidFiles\\\",\\n errors: TODO\\n}\\nOn error with the project as a whole (e.g. over quota):\\n{\\n code: \\\"invalidProject\\\",\\n errors: TODO\\n}\\nOn unexpected error (bug):\\n{\\n code: \\\"error\\\",\\n message: \\\"Unexpected Error\\\"\\n}\\n\\\\end{lstlisting}\\n\\n\\\\section{Test Data}\\n\\nYou can use this project as one of your servermock projects. I've added an attachment and a file in a subfolder to make it a bit more interesting.\\n\\n\\\\input{foo/bar/servermock}\\n\\n\\\\includegraphics[width=\\\\linewidth]{min_mean_wait_evm_7_eps_150dpi}\\n\\n\\\\end{document}", "main.tex"), + new SnapshotFile("This text is from another file.", "foo/bar/servermock.tex") ), Arrays.asList( new SnapshotAttachment("https://writelatex-staging.s3.amazonaws.com/filepicker/1ENnu6zJSGyslI3DuNZD_min_mean_wait_evm_7.eps.150dpi.png", "min_mean_wait_evm_7_eps_150dpi.png") )))); put(175, new SnapshotGetForVersionResult(new SnapshotData(Arrays.asList( - new SnapshotFile("\\\\documentclass[a4paper]{article}\\n\\n\\\\usepackage[english]{babel}\\n\\\\usepackage[utf8]{inputenc}\\n\\\\usepackage{graphicx}\\n\\\\usepackage{fullpage}\\n\\\\usepackage{listings}\\n\\\\usepackage{courier}\\n\\\\usepackage{url}\\n\\n\\\\lstset{basicstyle=\\\\ttfamily,breaklines=true}\\n\\n\\\\begin{document}\\n\\\\title{API for the writeLaTeX-Git Bridge}\\n\\\\author{JLM}\\n\\\\date{\\\\today}\\n\\\\maketitle\\n\\n\\\\section{Fetching a Project from WriteLaTeX}\\n\\nThere are three API calls that will likely be of interest. You can run them against this server, \\\\url{radiant-wind-3058.herokuapp.com}, but they're not on the production server yet.\\n\\n\\\\subsection{Get Doc}\\n\\nA ``doc'' is our internal term for a ``project''. At present, this just returns the latest version number.\\n\\n\\\\begin{lstlisting}\\nGET https://.../api/v0/docs/1826rqgsdb\\n# => { latestVerId: 39 }\\nTODO will also include updatedAt time and user (if it was not anonymous)\\n\\\\end{lstlisting}\\n\\n\\\\subsection{Get Saved Vers}\\n\\nA ``saved ver'' is a version of a doc, saved by via the versions menu. Note that this query is not currently paginated.\\n\\n\\\\begin{lstlisting}\\nGET https://.../api/v0/docs/1826rqgsdb/saved_vers\\n# => [\\n {\\\"versionId\\\":39,\\n \\\"comment\\\":\\\"with more files\\\",\\n \\\"user\\\":{\\n \\\"email\\\":\\\"jdleesmiller@gmail.com\\\",\\n \\\"name\\\":\\\"John Lees-Miller\\\"},\\n \\\"createdAt\\\":\\\"2014-11-05T18:02:19Z\\\"},\\n {\\\"versionId\\\":24,\\n \\\"comment\\\":\\\"first draft\\\",\\n \\\"user\\\":{\\n \\\"email\\\":\\\"jdleesmiller@gmail.com\\\",\\n \\\"name\\\":\\\"John Lees-Miller\\\"},\\n \\\"createdAt\\\":\\\"2014-11-05T17:56:58Z\\\"}]\\n\\\\end{lstlisting}\\n\\n\\\\subsection{Get Snapshot for Version}\\n\\nA snapshot contains the content of a project in the given version. You can safely request a snapshot of any version that is, or was at any point in the last 24 hours, (1) a saved version, or (2) the current version. (Older versions may or may not have been moved to cold storage.)\\n\\nThe srcs array contains (content, file name) pairs; the atts array contains (URL, file name) pairs.\\n\\n\\\\begin{lstlisting}\\nGET https://.../api/v0/docs/1826rqgsdb/snapshots/39\\n# => {\\n \\\"srcs\\\":[\\n [\\\"This text is from another file.\\\",\\\"foo/bar/test.tex\\\"],\\n [\\\"\\\\\\\\documentclass[a4paper]{article}\\\\n...\\\",\\\"main.tex\\\"]],\\n \\\"atts\\\":[\\n [\\\"https://writelatex-staging.s3.amazonaws.com/filepicker/1ENnu6zJSGyslI3DuNZD_min_mean_wait_evm_7.eps.150dpi.png\\\",\\\"min_mean_wait_evm_7_eps_150dpi.png\\\"]]}\\n\\\\end{lstlisting}\\n\\n\\\\section{Pushing a Project to WriteLaTeX}\\n\\n\\\\subsection{Push a Project}\\n\\n\\\\begin{lstlisting}\\n# NB: JLM originally said PUT, but he now thinks POST is better\\n# NB: you must set a Content-Type: application/json header for this request\\n# in order to specify the data as JSON in the request body\\nPOST https://.../api/v0/docs/1826rqgsdb/snapshots\\nData:\\n{\\n latestVerId: integer,\\n files: [\\n {\\n name: string path (forward slashes, relative to root)\\n url: string (but only if the file is modified; else no url given)\\n }, ...\\n ]\\n postbackUrl: url to post result back to\\n}\\nResponse on success:\\n{\\n status: 202,\\n code: \\\"accepted\\\",\\n message: \\\"Accepted\\\"\\n}\\nResponse on out of date:\\n{\\n status: 409, # Conflict\\n code: \\\"outOfDate\\\",\\n message: \\\"Out of Date\\\"\\n}\\n\\nPostback Data (METHOD POST):\\nOn success:\\n{\\n code: \\\"upToDate\\\",\\n latestVerId: integer\\n}\\nOn out of date:\\n{\\n code: \\\"outOfDate\\\",\\n message: \\\"Out of Date\\\"\\n}\\nOn error:\\n{\\n code: \\\"invalidFile\\\",\\n TODO\\n}\\n\\\\end{lstlisting}\\n\\n\\\\section{Test Data}\\n\\nYou can use this project as one of your test projects. I've added an attachment and a file in a subfolder to make it a bit more interesting.\\n\\n\\\\input{foo/bar/test}\\n\\n\\\\includegraphics[width=\\\\linewidth]{min_mean_wait_evm_7_eps_150dpi}\\n\\n\\\\end{document}", "main.tex"), - new SnapshotFile("This text is from another file.", "foo/bar/test.tex") + new SnapshotFile("\\\\documentclass[a4paper]{article}\\n\\n\\\\usepackage[english]{babel}\\n\\\\usepackage[utf8]{inputenc}\\n\\\\usepackage{graphicx}\\n\\\\usepackage{fullpage}\\n\\\\usepackage{listings}\\n\\\\usepackage{courier}\\n\\\\usepackage{url}\\n\\n\\\\lstset{basicstyle=\\\\ttfamily,breaklines=true}\\n\\n\\\\begin{document}\\n\\\\title{API for the writeLaTeX-Git Bridge}\\n\\\\author{JLM}\\n\\\\date{\\\\today}\\n\\\\maketitle\\n\\n\\\\section{Fetching a Project from WriteLaTeX}\\n\\nThere are three API calls that will likely be of interest. You can run them against this server, \\\\url{radiant-wind-3058.herokuapp.com}, but they're not on the production server yet.\\n\\n\\\\subsection{Get Doc}\\n\\nA ``doc'' is our internal term for a ``project''. At present, this just returns the latest version number.\\n\\n\\\\begin{lstlisting}\\nGET https://.../api/v0/docs/1826rqgsdb\\n# => { latestVerId: 39 }\\nTODO will also include updatedAt time and user (if it was not anonymous)\\n\\\\end{lstlisting}\\n\\n\\\\subsection{Get Saved Vers}\\n\\nA ``saved ver'' is a version of a doc, saved by via the versions menu. Note that this query is not currently paginated.\\n\\n\\\\begin{lstlisting}\\nGET https://.../api/v0/docs/1826rqgsdb/saved_vers\\n# => [\\n {\\\"versionId\\\":39,\\n \\\"comment\\\":\\\"with more files\\\",\\n \\\"user\\\":{\\n \\\"email\\\":\\\"jdleesmiller@gmail.com\\\",\\n \\\"name\\\":\\\"John Lees-Miller\\\"},\\n \\\"createdAt\\\":\\\"2014-11-05T18:02:19Z\\\"},\\n {\\\"versionId\\\":24,\\n \\\"comment\\\":\\\"first draft\\\",\\n \\\"user\\\":{\\n \\\"email\\\":\\\"jdleesmiller@gmail.com\\\",\\n \\\"name\\\":\\\"John Lees-Miller\\\"},\\n \\\"createdAt\\\":\\\"2014-11-05T17:56:58Z\\\"}]\\n\\\\end{lstlisting}\\n\\n\\\\subsection{Get Snapshot for Version}\\n\\nA snapshot contains the content of a project in the given version. You can safely request a snapshot of any version that is, or was at any point in the last 24 hours, (1) a saved version, or (2) the current version. (Older versions may or may not have been moved to cold storage.)\\n\\nThe srcs array contains (content, file name) pairs; the atts array contains (URL, file name) pairs.\\n\\n\\\\begin{lstlisting}\\nGET https://.../api/v0/docs/1826rqgsdb/snapshots/39\\n# => {\\n \\\"srcs\\\":[\\n [\\\"This text is from another file.\\\",\\\"foo/bar/servermock.tex\\\"],\\n [\\\"\\\\\\\\documentclass[a4paper]{article}\\\\n...\\\",\\\"main.tex\\\"]],\\n \\\"atts\\\":[\\n [\\\"https://writelatex-staging.s3.amazonaws.com/filepicker/1ENnu6zJSGyslI3DuNZD_min_mean_wait_evm_7.eps.150dpi.png\\\",\\\"min_mean_wait_evm_7_eps_150dpi.png\\\"]]}\\n\\\\end{lstlisting}\\n\\n\\\\section{Pushing a Project to WriteLaTeX}\\n\\n\\\\subsection{Push a Project}\\n\\n\\\\begin{lstlisting}\\n# NB: JLM originally said PUT, but he now thinks POST is better\\n# NB: you must set a Content-Type: application/json header for this request\\n# in order to specify the data as JSON in the request body\\nPOST https://.../api/v0/docs/1826rqgsdb/snapshots\\nData:\\n{\\n latestVerId: integer,\\n files: [\\n {\\n name: string path (forward slashes, relative to root)\\n url: string (but only if the file is modified; else no url given)\\n }, ...\\n ]\\n postbackUrl: url to post result back to\\n}\\nResponse on success:\\n{\\n status: 202,\\n code: \\\"accepted\\\",\\n message: \\\"Accepted\\\"\\n}\\nResponse on out of date:\\n{\\n status: 409, # Conflict\\n code: \\\"outOfDate\\\",\\n message: \\\"Out of Date\\\"\\n}\\n\\nPostback Data (METHOD POST):\\nOn success:\\n{\\n code: \\\"upToDate\\\",\\n latestVerId: integer\\n}\\nOn out of date:\\n{\\n code: \\\"outOfDate\\\",\\n message: \\\"Out of Date\\\"\\n}\\nOn error:\\n{\\n code: \\\"invalidFile\\\",\\n TODO\\n}\\n\\\\end{lstlisting}\\n\\n\\\\section{Test Data}\\n\\nYou can use this project as one of your servermock projects. I've added an attachment and a file in a subfolder to make it a bit more interesting.\\n\\n\\\\input{foo/bar/servermock}\\n\\n\\\\includegraphics[width=\\\\linewidth]{min_mean_wait_evm_7_eps_150dpi}\\n\\n\\\\end{document}", "main.tex"), + new SnapshotFile("This text is from another file.", "foo/bar/servermock.tex") ), Arrays.asList( new SnapshotAttachment("https://writelatex-staging.s3.amazonaws.com/filepicker/1ENnu6zJSGyslI3DuNZD_min_mean_wait_evm_7.eps.150dpi.png", "min_mean_wait_evm_7_eps_150dpi.png") )))); put(146, new SnapshotGetForVersionResult(new SnapshotData(Arrays.asList( - new SnapshotFile("\\\\documentclass[a4paper]{article}\\n\\n\\\\usepackage[english]{babel}\\n\\\\usepackage[utf8]{inputenc}\\n\\\\usepackage{graphicx}\\n\\\\usepackage{fullpage}\\n\\\\usepackage{listings}\\n\\\\usepackage{courier}\\n\\\\usepackage{url}\\n\\n\\\\lstset{basicstyle=\\\\ttfamily,breaklines=true}\\n\\n\\\\begin{document}\\n\\\\title{API for the writeLaTeX-Git Bridge}\\n\\\\author{JLM}\\n\\\\date{\\\\today}\\n\\\\maketitle\\n\\n\\\\section{Fetching a Project from WriteLaTeX}\\n\\nThere are three API calls that will likely be of interest. You can run them against this server, \\\\url{radiant-wind-3058.herokuapp.com}, but they're not on the production server yet.\\n\\n\\\\subsection{Get Doc}\\n\\nA ``doc'' is our internal term for a ``project''. At present, this just returns the latest version number.\\n\\n\\\\begin{lstlisting}\\nGET https://.../api/v0/docs/1826rqgsdb\\n# => { latestVerId: 39 }\\n\\\\end{lstlisting}\\n\\n\\\\subsection{Get Saved Vers}\\n\\nA ``saved ver'' is a version of a doc, saved by via the versions menu. Note that this query is not currently paginated.\\n\\n\\\\begin{lstlisting}\\nGET https://.../api/v0/docs/1826rqgsdb/saved_vers\\n# => [\\n {\\\"versionId\\\":39,\\n \\\"comment\\\":\\\"with more files\\\",\\n \\\"user\\\":{\\n \\\"email\\\":\\\"jdleesmiller@gmail.com\\\",\\n \\\"name\\\":\\\"John Lees-Miller\\\"},\\n \\\"createdAt\\\":\\\"2014-11-05T18:02:19Z\\\"},\\n {\\\"versionId\\\":24,\\n \\\"comment\\\":\\\"first draft\\\",\\n \\\"user\\\":{\\n \\\"email\\\":\\\"jdleesmiller@gmail.com\\\",\\n \\\"name\\\":\\\"John Lees-Miller\\\"},\\n \\\"createdAt\\\":\\\"2014-11-05T17:56:58Z\\\"}]\\n\\\\end{lstlisting}\\n\\n\\\\subsection{Get Snapshot for Version}\\n\\nA snapshot contains the content of a project in the given version. You can safely request a snapshot of any version that is, or was at any point in the last 24 hours, (1) a saved version, or (2) the current version. (Older versions may or may not have been moved to cold storage.)\\n\\nThe srcs array contains (content, file name) pairs; the atts array contains (URL, file name) pairs.\\n\\n\\\\begin{lstlisting}\\nGET https://.../api/v0/docs/1826rqgsdb/snapshots/39\\n# => {\\n \\\"srcs\\\":[\\n [\\\"This text is from another file.\\\",\\\"foo/bar/test.tex\\\"],\\n [\\\"\\\\\\\\documentclass[a4paper]{article}\\\\n...\\\",\\\"main.tex\\\"]],\\n \\\"atts\\\":[\\n [\\\"https://writelatex-staging.s3.amazonaws.com/filepicker/1ENnu6zJSGyslI3DuNZD_min_mean_wait_evm_7.eps.150dpi.png\\\",\\\"min_mean_wait_evm_7_eps_150dpi.png\\\"]]}\\n\\\\end{lstlisting}\\n\\n\\\\section{Pushing a Project to WriteLaTeX}\\n\\n\\\\subsection{Push a Project}\\n\\n\\\\begin{lstlisting}\\nPUT https://.../api/v0/docs/1826rqgsdb/snapshots\\nData:\\n{\\n latestVerId: integer,\\n files: [\\n {\\n name: string path (forward slashes, relative to root)\\n url: string (but only if the file is modified; else no url given)\\n }, ...\\n ]\\n postbackUrl: url to post result back to\\n}\\nResponse on success:\\n{\\n status: 20x,\\n}\\nResponse on out of date:\\n{\\n status: 40x,\\n code: \\\"outOfDate\\\",\\n message: \\\"Out of Date\\\"\\n}\\n\\nPostback Data (METHOD POST):\\nOn success:\\n{\\n code: \\\"upToDate\\\",\\n latestVerId: integer\\n}\\nOn out of date:\\n{\\n code: \\\"outOfDate\\\",\\n message: \\\"Out of Date\\\"\\n}\\nOn error:\\n{\\n code: \\\"invalidFile\\\",\\n TODO\\n}\\n\\\\end{lstlisting}\\n\\n\\\\section{Test Data}\\n\\nYou can use this project as one of your test projects. I've added an attachment and a file in a subfolder to make it a bit more interesting.\\n\\n\\\\input{foo/bar/test}\\n\\n\\\\includegraphics[width=\\\\linewidth]{min_mean_wait_evm_7_eps_150dpi}\\n\\n\\\\end{document}", "main.tex"), - new SnapshotFile("This text is from another file.", "foo/bar/test.tex") + new SnapshotFile("\\\\documentclass[a4paper]{article}\\n\\n\\\\usepackage[english]{babel}\\n\\\\usepackage[utf8]{inputenc}\\n\\\\usepackage{graphicx}\\n\\\\usepackage{fullpage}\\n\\\\usepackage{listings}\\n\\\\usepackage{courier}\\n\\\\usepackage{url}\\n\\n\\\\lstset{basicstyle=\\\\ttfamily,breaklines=true}\\n\\n\\\\begin{document}\\n\\\\title{API for the writeLaTeX-Git Bridge}\\n\\\\author{JLM}\\n\\\\date{\\\\today}\\n\\\\maketitle\\n\\n\\\\section{Fetching a Project from WriteLaTeX}\\n\\nThere are three API calls that will likely be of interest. You can run them against this server, \\\\url{radiant-wind-3058.herokuapp.com}, but they're not on the production server yet.\\n\\n\\\\subsection{Get Doc}\\n\\nA ``doc'' is our internal term for a ``project''. At present, this just returns the latest version number.\\n\\n\\\\begin{lstlisting}\\nGET https://.../api/v0/docs/1826rqgsdb\\n# => { latestVerId: 39 }\\n\\\\end{lstlisting}\\n\\n\\\\subsection{Get Saved Vers}\\n\\nA ``saved ver'' is a version of a doc, saved by via the versions menu. Note that this query is not currently paginated.\\n\\n\\\\begin{lstlisting}\\nGET https://.../api/v0/docs/1826rqgsdb/saved_vers\\n# => [\\n {\\\"versionId\\\":39,\\n \\\"comment\\\":\\\"with more files\\\",\\n \\\"user\\\":{\\n \\\"email\\\":\\\"jdleesmiller@gmail.com\\\",\\n \\\"name\\\":\\\"John Lees-Miller\\\"},\\n \\\"createdAt\\\":\\\"2014-11-05T18:02:19Z\\\"},\\n {\\\"versionId\\\":24,\\n \\\"comment\\\":\\\"first draft\\\",\\n \\\"user\\\":{\\n \\\"email\\\":\\\"jdleesmiller@gmail.com\\\",\\n \\\"name\\\":\\\"John Lees-Miller\\\"},\\n \\\"createdAt\\\":\\\"2014-11-05T17:56:58Z\\\"}]\\n\\\\end{lstlisting}\\n\\n\\\\subsection{Get Snapshot for Version}\\n\\nA snapshot contains the content of a project in the given version. You can safely request a snapshot of any version that is, or was at any point in the last 24 hours, (1) a saved version, or (2) the current version. (Older versions may or may not have been moved to cold storage.)\\n\\nThe srcs array contains (content, file name) pairs; the atts array contains (URL, file name) pairs.\\n\\n\\\\begin{lstlisting}\\nGET https://.../api/v0/docs/1826rqgsdb/snapshots/39\\n# => {\\n \\\"srcs\\\":[\\n [\\\"This text is from another file.\\\",\\\"foo/bar/servermock.tex\\\"],\\n [\\\"\\\\\\\\documentclass[a4paper]{article}\\\\n...\\\",\\\"main.tex\\\"]],\\n \\\"atts\\\":[\\n [\\\"https://writelatex-staging.s3.amazonaws.com/filepicker/1ENnu6zJSGyslI3DuNZD_min_mean_wait_evm_7.eps.150dpi.png\\\",\\\"min_mean_wait_evm_7_eps_150dpi.png\\\"]]}\\n\\\\end{lstlisting}\\n\\n\\\\section{Pushing a Project to WriteLaTeX}\\n\\n\\\\subsection{Push a Project}\\n\\n\\\\begin{lstlisting}\\nPUT https://.../api/v0/docs/1826rqgsdb/snapshots\\nData:\\n{\\n latestVerId: integer,\\n files: [\\n {\\n name: string path (forward slashes, relative to root)\\n url: string (but only if the file is modified; else no url given)\\n }, ...\\n ]\\n postbackUrl: url to post result back to\\n}\\nResponse on success:\\n{\\n status: 20x,\\n}\\nResponse on out of date:\\n{\\n status: 40x,\\n code: \\\"outOfDate\\\",\\n message: \\\"Out of Date\\\"\\n}\\n\\nPostback Data (METHOD POST):\\nOn success:\\n{\\n code: \\\"upToDate\\\",\\n latestVerId: integer\\n}\\nOn out of date:\\n{\\n code: \\\"outOfDate\\\",\\n message: \\\"Out of Date\\\"\\n}\\nOn error:\\n{\\n code: \\\"invalidFile\\\",\\n TODO\\n}\\n\\\\end{lstlisting}\\n\\n\\\\section{Test Data}\\n\\nYou can use this project as one of your servermock projects. I've added an attachment and a file in a subfolder to make it a bit more interesting.\\n\\n\\\\input{foo/bar/servermock}\\n\\n\\\\includegraphics[width=\\\\linewidth]{min_mean_wait_evm_7_eps_150dpi}\\n\\n\\\\end{document}", "main.tex"), + new SnapshotFile("This text is from another file.", "foo/bar/servermock.tex") ), Arrays.asList( new SnapshotAttachment("https://writelatex-staging.s3.amazonaws.com/filepicker/1ENnu6zJSGyslI3DuNZD_min_mean_wait_evm_7.eps.150dpi.png", "min_mean_wait_evm_7_eps_150dpi.png") )))); put(74, new SnapshotGetForVersionResult(new SnapshotData(Arrays.asList( - new SnapshotFile("\\\\documentclass[a4paper]{article}\\n\\n\\\\usepackage[english]{babel}\\n\\\\usepackage[utf8]{inputenc}\\n\\\\usepackage{graphicx}\\n\\\\usepackage{fullpage}\\n\\\\usepackage{listings}\\n\\\\usepackage{courier}\\n\\\\usepackage{url}\\n\\n\\\\lstset{basicstyle=\\\\ttfamily,breaklines=true}\\n\\n\\\\begin{document}\\n\\\\title{API for the writeLaTeX-Git Bridge}\\n\\\\author{JLM}\\n\\\\date{\\\\today}\\n\\\\maketitle\\n\\n\\\\section{Fetching a Project from WriteLaTeX}\\n\\nThere are three API calls that will likely be of interest. You can run them against this server, \\\\url{radiant-wind-3058.herokuapp.com}, but they're not on the production server yet.\\n\\n\\\\subsection{Get Doc}\\n\\nA ``doc'' is our internal term for a ``project''. At present, this just returns the latest version number.\\n\\n\\\\begin{lstlisting}\\nGET https://.../api/v0/docs/1826rqgsdb\\n# => { latestVerId: 39 }\\n\\\\end{lstlisting}\\n\\n\\\\subsection{Get Saved Vers}\\n\\nA ``saved ver'' is a version of a doc, saved by via the versions menu. Note that this query is not currently paginated.\\n\\n\\\\begin{lstlisting}\\nGET https://.../api/v0/docs/1826rqgsdb/saved_vers\\n# => [\\n {\\\"versionId\\\":39,\\n \\\"comment\\\":\\\"with more files\\\",\\n \\\"user\\\":{\\n \\\"email\\\":\\\"jdleesmiller@gmail.com\\\",\\n \\\"name\\\":\\\"John Lees-Miller\\\"},\\n \\\"createdAt\\\":\\\"2014-11-05T18:02:19Z\\\"},\\n {\\\"versionId\\\":24,\\n \\\"comment\\\":\\\"first draft\\\",\\n \\\"user\\\":{\\n \\\"email\\\":\\\"jdleesmiller@gmail.com\\\",\\n \\\"name\\\":\\\"John Lees-Miller\\\"},\\n \\\"createdAt\\\":\\\"2014-11-05T17:56:58Z\\\"}]\\n\\\\end{lstlisting}\\n\\n\\\\subsection{Get Snapshot for Version}\\n\\nA snapshot contains the content of a project in the given version. You can safely request a snapshot of any version that is, or was at any point in the last 24 hours, (1) a saved version, or (2) the current version. (Older versions may or may not have been moved to cold storage.)\\n\\nThe srcs array contains (content, file name) pairs; the atts array contains (URL, file name) pairs.\\n\\n\\\\begin{lstlisting}\\nGET https://.../api/v0/docs/1826rqgsdb/snapshots/39\\n# => {\\n \\\"srcs\\\":[\\n [\\\"This text is from another file.\\\",\\\"foo/bar/test.tex\\\"],\\n [\\\"\\\\\\\\documentclass[a4paper]{article}\\\\n...\\\",\\\"main.tex\\\"]],\\n \\\"atts\\\":[\\n [\\\"https://writelatex-staging.s3.amazonaws.com/filepicker/1ENnu6zJSGyslI3DuNZD_min_mean_wait_evm_7.eps.150dpi.png\\\",\\\"min_mean_wait_evm_7_eps_150dpi.png\\\"]]}\\n\\\\end{lstlisting}\\n\\n\\\\section{Pushing a Project to WriteLaTeX}\\n\\nTODO still working on this part\\n\\n\\\\section{Test Data}\\n\\nYou can use this project as a test project. I've added an attachment and a file in a subfolder to make it a bit more interesting.\\n\\n\\\\input{foo/bar/test}\\n\\n\\\\includegraphics[width=\\\\linewidth]{min_mean_wait_evm_7_eps_150dpi}\\n\\n\\\\end{document}", "main.tex"), - new SnapshotFile("This text is from another file.", "foo/bar/test.tex") + new SnapshotFile("\\\\documentclass[a4paper]{article}\\n\\n\\\\usepackage[english]{babel}\\n\\\\usepackage[utf8]{inputenc}\\n\\\\usepackage{graphicx}\\n\\\\usepackage{fullpage}\\n\\\\usepackage{listings}\\n\\\\usepackage{courier}\\n\\\\usepackage{url}\\n\\n\\\\lstset{basicstyle=\\\\ttfamily,breaklines=true}\\n\\n\\\\begin{document}\\n\\\\title{API for the writeLaTeX-Git Bridge}\\n\\\\author{JLM}\\n\\\\date{\\\\today}\\n\\\\maketitle\\n\\n\\\\section{Fetching a Project from WriteLaTeX}\\n\\nThere are three API calls that will likely be of interest. You can run them against this server, \\\\url{radiant-wind-3058.herokuapp.com}, but they're not on the production server yet.\\n\\n\\\\subsection{Get Doc}\\n\\nA ``doc'' is our internal term for a ``project''. At present, this just returns the latest version number.\\n\\n\\\\begin{lstlisting}\\nGET https://.../api/v0/docs/1826rqgsdb\\n# => { latestVerId: 39 }\\n\\\\end{lstlisting}\\n\\n\\\\subsection{Get Saved Vers}\\n\\nA ``saved ver'' is a version of a doc, saved by via the versions menu. Note that this query is not currently paginated.\\n\\n\\\\begin{lstlisting}\\nGET https://.../api/v0/docs/1826rqgsdb/saved_vers\\n# => [\\n {\\\"versionId\\\":39,\\n \\\"comment\\\":\\\"with more files\\\",\\n \\\"user\\\":{\\n \\\"email\\\":\\\"jdleesmiller@gmail.com\\\",\\n \\\"name\\\":\\\"John Lees-Miller\\\"},\\n \\\"createdAt\\\":\\\"2014-11-05T18:02:19Z\\\"},\\n {\\\"versionId\\\":24,\\n \\\"comment\\\":\\\"first draft\\\",\\n \\\"user\\\":{\\n \\\"email\\\":\\\"jdleesmiller@gmail.com\\\",\\n \\\"name\\\":\\\"John Lees-Miller\\\"},\\n \\\"createdAt\\\":\\\"2014-11-05T17:56:58Z\\\"}]\\n\\\\end{lstlisting}\\n\\n\\\\subsection{Get Snapshot for Version}\\n\\nA snapshot contains the content of a project in the given version. You can safely request a snapshot of any version that is, or was at any point in the last 24 hours, (1) a saved version, or (2) the current version. (Older versions may or may not have been moved to cold storage.)\\n\\nThe srcs array contains (content, file name) pairs; the atts array contains (URL, file name) pairs.\\n\\n\\\\begin{lstlisting}\\nGET https://.../api/v0/docs/1826rqgsdb/snapshots/39\\n# => {\\n \\\"srcs\\\":[\\n [\\\"This text is from another file.\\\",\\\"foo/bar/servermock.tex\\\"],\\n [\\\"\\\\\\\\documentclass[a4paper]{article}\\\\n...\\\",\\\"main.tex\\\"]],\\n \\\"atts\\\":[\\n [\\\"https://writelatex-staging.s3.amazonaws.com/filepicker/1ENnu6zJSGyslI3DuNZD_min_mean_wait_evm_7.eps.150dpi.png\\\",\\\"min_mean_wait_evm_7_eps_150dpi.png\\\"]]}\\n\\\\end{lstlisting}\\n\\n\\\\section{Pushing a Project to WriteLaTeX}\\n\\nTODO still working on this part\\n\\n\\\\section{Test Data}\\n\\nYou can use this project as a servermock project. I've added an attachment and a file in a subfolder to make it a bit more interesting.\\n\\n\\\\input{foo/bar/servermock}\\n\\n\\\\includegraphics[width=\\\\linewidth]{min_mean_wait_evm_7_eps_150dpi}\\n\\n\\\\end{document}", "main.tex"), + new SnapshotFile("This text is from another file.", "foo/bar/servermock.tex") ), Arrays.asList( new SnapshotAttachment("https://writelatex-staging.s3.amazonaws.com/filepicker/1ENnu6zJSGyslI3DuNZD_min_mean_wait_evm_7.eps.150dpi.png", "min_mean_wait_evm_7_eps_150dpi.png") )))); put(39, new SnapshotGetForVersionResult(new SnapshotData(Arrays.asList( - new SnapshotFile("\\\\documentclass[a4paper]{article}\\n\\n\\\\usepackage[english]{babel}\\n\\\\usepackage[utf8]{inputenc}\\n\\\\usepackage{graphicx}\\n\\\\usepackage{fullpage}\\n\\\\usepackage{listings}\\n\\\\usepackage{courier}\\n\\\\usepackage{url}\\n\\n\\\\lstset{basicstyle=\\\\ttfamily,breaklines=true}\\n\\n\\\\begin{document}\\n\\\\title{API for the writeLaTeX-Git Bridge}\\n\\\\author{JLM}\\n\\\\date{\\\\today}\\n\\\\maketitle\\n\\n\\\\section{Fetching a Project from WriteLaTeX}\\n\\nThere are three API calls that will likely be of interest. You can run them against this server, \\\\url{radiant-wind-3058.herokuapp.com}, but they're not on the production server yet.\\n\\n\\\\subsection{Get Doc}\\n\\nA ``doc'' is our internal term for a ``project''. At present, this just returns the latest version number.\\n\\n\\\\begin{lstlisting}\\nGET https://.../api/v0/docs/1826rqgsdb\\n\\\\end{lstlisting}\\n\\n\\\\subsection{Get Saved Vers}\\n\\nA ``saved ver'' is a version of a doc, saved by via the versions menu. To list saved versions for a doc:\\n\\n\\\\begin{lstlisting}\\nGET https://.../api/v0/docs/1826rqgsdb/saved_vers\\n\\\\end{lstlisting}\\n\\n\\\\subsection{Get Snapshot for Version}\\n\\nA snapshot contains the content of a project in the given version. You can safely request a snapshot of any version that is, or was at any point in the last 24 hours, (1) a saved version, or (2) the current version. (Older versions may or may not have been moved to cold storage.)\\n\\n\\\\begin{lstlisting}\\nGET https://.../api/v0/docs/1826rqgsdb/snapshots/1\\n\\\\end{lstlisting}\\n\\n\\\\section{Pushing a Project to WriteLaTeX}\\n\\nTODO still working on this part\\n\\n\\\\section{Test Data}\\n\\nYou can use this project as a test project. I've added an attachment and a file in a subfolder to make it a bit more interesting.\\n\\n\\\\input{foo/bar/test}\\n\\n\\\\includegraphics[width=\\\\linewidth]{min_mean_wait_evm_7_eps_150dpi}\\n\\n\\\\end{document}", "main.tex"), - new SnapshotFile("This text is from another file.", "foo/bar/test.tex") + new SnapshotFile("\\\\documentclass[a4paper]{article}\\n\\n\\\\usepackage[english]{babel}\\n\\\\usepackage[utf8]{inputenc}\\n\\\\usepackage{graphicx}\\n\\\\usepackage{fullpage}\\n\\\\usepackage{listings}\\n\\\\usepackage{courier}\\n\\\\usepackage{url}\\n\\n\\\\lstset{basicstyle=\\\\ttfamily,breaklines=true}\\n\\n\\\\begin{document}\\n\\\\title{API for the writeLaTeX-Git Bridge}\\n\\\\author{JLM}\\n\\\\date{\\\\today}\\n\\\\maketitle\\n\\n\\\\section{Fetching a Project from WriteLaTeX}\\n\\nThere are three API calls that will likely be of interest. You can run them against this server, \\\\url{radiant-wind-3058.herokuapp.com}, but they're not on the production server yet.\\n\\n\\\\subsection{Get Doc}\\n\\nA ``doc'' is our internal term for a ``project''. At present, this just returns the latest version number.\\n\\n\\\\begin{lstlisting}\\nGET https://.../api/v0/docs/1826rqgsdb\\n\\\\end{lstlisting}\\n\\n\\\\subsection{Get Saved Vers}\\n\\nA ``saved ver'' is a version of a doc, saved by via the versions menu. To list saved versions for a doc:\\n\\n\\\\begin{lstlisting}\\nGET https://.../api/v0/docs/1826rqgsdb/saved_vers\\n\\\\end{lstlisting}\\n\\n\\\\subsection{Get Snapshot for Version}\\n\\nA snapshot contains the content of a project in the given version. You can safely request a snapshot of any version that is, or was at any point in the last 24 hours, (1) a saved version, or (2) the current version. (Older versions may or may not have been moved to cold storage.)\\n\\n\\\\begin{lstlisting}\\nGET https://.../api/v0/docs/1826rqgsdb/snapshots/1\\n\\\\end{lstlisting}\\n\\n\\\\section{Pushing a Project to WriteLaTeX}\\n\\nTODO still working on this part\\n\\n\\\\section{Test Data}\\n\\nYou can use this project as a servermock project. I've added an attachment and a file in a subfolder to make it a bit more interesting.\\n\\n\\\\input{foo/bar/servermock}\\n\\n\\\\includegraphics[width=\\\\linewidth]{min_mean_wait_evm_7_eps_150dpi}\\n\\n\\\\end{document}", "main.tex"), + new SnapshotFile("This text is from another file.", "foo/bar/servermock.tex") ), Arrays.asList( new SnapshotAttachment("https://writelatex-staging.s3.amazonaws.com/filepicker/1ENnu6zJSGyslI3DuNZD_min_mean_wait_evm_7.eps.150dpi.png", "min_mean_wait_evm_7_eps_150dpi.png") )))); put(24, new SnapshotGetForVersionResult(new SnapshotData(Arrays.asList( - new SnapshotFile("\\\\documentclass[a4paper]{article}\\n\\n\\\\usepackage[english]{babel}\\n\\\\usepackage[utf8]{inputenc}\\n\\\\usepackage{graphicx}\\n\\\\usepackage{fullpage}\\n\\\\usepackage{listings}\\n\\\\usepackage{courier}\\n\\\\usepackage{url}\\n\\n\\\\lstset{basicstyle=\\\\ttfamily,breaklines=true}\\n\\n\\\\begin{document}\\n\\\\title{API for the writeLaTeX-Git Bridge}\\n\\\\author{JLM}\\n\\\\date{\\\\today}\\n\\\\maketitle\\n\\n\\\\section{Fetching a Project from WriteLaTeX}\\n\\nThere are three API calls that will likely be of interest. You can run them against this server (radiant-wind-3058.herokuapp.com).\\n\\n\\\\subsection{Get Doc}\\n\\nA ``doc'' is our internal term for a ``project''. At present, this just returns the latest version number.\\n\\n\\\\begin{lstlisting}\\nGET https://radiant-wind.....com/api/v0/docs/1826rqgsdb\\n\\\\end{lstlisting}\\n\\n\\\\subsection{Get Saved Vers}\\n\\nA ``saved ver'' is a version of a doc, saved by via the versions menu. To list saved versions for a doc:\\n\\n\\\\begin{lstlisting}\\nGET https://radiant-wind.....com/api/v0/docs/1826rqgsdb/saved_vers\\n\\\\end{lstlisting}\\n\\n\\\\subsection{Get Snapshot for Version}\\n\\nA snapshot contains the content of a project in the given version. You can safely request a snapshot of any version that is, or was at any point in the last 24 hours, (1) a saved version, or (2) the current version. (Older versions may or may not have been moved to cold storage.)\\n\\n\\\\begin{lstlisting}\\nGET https://radiant-wind.....com/api/v0/docs/1826rqgsdb/snapshots/1\\n\\\\end{lstlisting}\\n\\n\\\\section{Pushing a Project to WriteLaTeX}\\n\\nTODO still working on this part\\n\\n\\\\section{Test Data}\\n\\nYou can use this project as a test project. Here is an extra file to make it a bit more interesting.\\n\\n\\\\includegraphics[width=\\\\linewidth]{min_mean_wait_evm_7_eps_150dpi}\\n\\n\\\\end{document}", "main.tex") + new SnapshotFile("\\\\documentclass[a4paper]{article}\\n\\n\\\\usepackage[english]{babel}\\n\\\\usepackage[utf8]{inputenc}\\n\\\\usepackage{graphicx}\\n\\\\usepackage{fullpage}\\n\\\\usepackage{listings}\\n\\\\usepackage{courier}\\n\\\\usepackage{url}\\n\\n\\\\lstset{basicstyle=\\\\ttfamily,breaklines=true}\\n\\n\\\\begin{document}\\n\\\\title{API for the writeLaTeX-Git Bridge}\\n\\\\author{JLM}\\n\\\\date{\\\\today}\\n\\\\maketitle\\n\\n\\\\section{Fetching a Project from WriteLaTeX}\\n\\nThere are three API calls that will likely be of interest. You can run them against this server (radiant-wind-3058.herokuapp.com).\\n\\n\\\\subsection{Get Doc}\\n\\nA ``doc'' is our internal term for a ``project''. At present, this just returns the latest version number.\\n\\n\\\\begin{lstlisting}\\nGET https://radiant-wind.....com/api/v0/docs/1826rqgsdb\\n\\\\end{lstlisting}\\n\\n\\\\subsection{Get Saved Vers}\\n\\nA ``saved ver'' is a version of a doc, saved by via the versions menu. To list saved versions for a doc:\\n\\n\\\\begin{lstlisting}\\nGET https://radiant-wind.....com/api/v0/docs/1826rqgsdb/saved_vers\\n\\\\end{lstlisting}\\n\\n\\\\subsection{Get Snapshot for Version}\\n\\nA snapshot contains the content of a project in the given version. You can safely request a snapshot of any version that is, or was at any point in the last 24 hours, (1) a saved version, or (2) the current version. (Older versions may or may not have been moved to cold storage.)\\n\\n\\\\begin{lstlisting}\\nGET https://radiant-wind.....com/api/v0/docs/1826rqgsdb/snapshots/1\\n\\\\end{lstlisting}\\n\\n\\\\section{Pushing a Project to WriteLaTeX}\\n\\nTODO still working on this part\\n\\n\\\\section{Test Data}\\n\\nYou can use this project as a servermock project. Here is an extra file to make it a bit more interesting.\\n\\n\\\\includegraphics[width=\\\\linewidth]{min_mean_wait_evm_7_eps_150dpi}\\n\\n\\\\end{document}", "main.tex") ), Arrays.asList( new SnapshotAttachment("https://writelatex-staging.s3.amazonaws.com/filepicker/1ENnu6zJSGyslI3DuNZD_min_mean_wait_evm_7.eps.150dpi.png", "min_mean_wait_evm_7_eps_150dpi.png") )))); diff --git a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/test/state/SnapshotAPIStateBuilder.java b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/servermock/state/SnapshotAPIStateBuilder.java similarity index 86% rename from services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/test/state/SnapshotAPIStateBuilder.java rename to services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/servermock/state/SnapshotAPIStateBuilder.java index fc034222df..52a1433eba 100644 --- a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/test/state/SnapshotAPIStateBuilder.java +++ b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/servermock/state/SnapshotAPIStateBuilder.java @@ -1,21 +1,21 @@ -package uk.ac.ic.wlgitbridge.test.state; +package uk.ac.ic.wlgitbridge.snapshot.servermock.state; import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; import com.google.gson.JsonObject; -import uk.ac.ic.wlgitbridge.test.response.push.data.SnapshotPushResult; -import uk.ac.ic.wlgitbridge.test.response.push.data.SnapshotPushResultOutOfDate; -import uk.ac.ic.wlgitbridge.test.response.push.data.SnapshotPushResultSuccess; -import uk.ac.ic.wlgitbridge.test.response.push.postback.*; -import uk.ac.ic.wlgitbridge.test.response.push.postback.invalidfile.InvalidFileError; -import uk.ac.ic.wlgitbridge.writelatex.api.request.getdoc.SnapshotGetDocResult; -import uk.ac.ic.wlgitbridge.writelatex.api.request.getforversion.SnapshotAttachment; -import uk.ac.ic.wlgitbridge.writelatex.api.request.getforversion.SnapshotData; -import uk.ac.ic.wlgitbridge.writelatex.api.request.getforversion.SnapshotFile; -import uk.ac.ic.wlgitbridge.writelatex.api.request.getforversion.SnapshotGetForVersionResult; -import uk.ac.ic.wlgitbridge.writelatex.api.request.getsavedvers.SnapshotGetSavedVersResult; -import uk.ac.ic.wlgitbridge.writelatex.api.request.getsavedvers.SnapshotInfo; +import uk.ac.ic.wlgitbridge.snapshot.servermock.response.push.data.SnapshotPushResult; +import uk.ac.ic.wlgitbridge.snapshot.servermock.response.push.data.SnapshotPushResultOutOfDate; +import uk.ac.ic.wlgitbridge.snapshot.servermock.response.push.data.SnapshotPushResultSuccess; +import uk.ac.ic.wlgitbridge.snapshot.servermock.response.push.postback.*; +import uk.ac.ic.wlgitbridge.snapshot.servermock.response.push.postback.invalidfile.InvalidFileError; +import uk.ac.ic.wlgitbridge.snapshot.getdoc.SnapshotGetDocResult; +import uk.ac.ic.wlgitbridge.snapshot.getforversion.SnapshotAttachment; +import uk.ac.ic.wlgitbridge.snapshot.getforversion.SnapshotData; +import uk.ac.ic.wlgitbridge.snapshot.getforversion.SnapshotFile; +import uk.ac.ic.wlgitbridge.snapshot.getforversion.SnapshotGetForVersionResult; +import uk.ac.ic.wlgitbridge.snapshot.getsavedvers.SnapshotGetSavedVersResult; +import uk.ac.ic.wlgitbridge.snapshot.getsavedvers.SnapshotInfo; import java.io.InputStream; import java.io.InputStreamReader; diff --git a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/test/state/SnapshotAPIStateManager.java b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/servermock/state/SnapshotAPIStateManager.java similarity index 61% rename from services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/test/state/SnapshotAPIStateManager.java rename to services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/servermock/state/SnapshotAPIStateManager.java index 5eb3611bb7..61c0921764 100644 --- a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/test/state/SnapshotAPIStateManager.java +++ b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/servermock/state/SnapshotAPIStateManager.java @@ -1,4 +1,4 @@ -package uk.ac.ic.wlgitbridge.test.state; +package uk.ac.ic.wlgitbridge.snapshot.servermock.state; /** * Created by Winston on 11/01/15. diff --git a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/test/util/FileUtil.java b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/servermock/util/FileUtil.java similarity index 98% rename from services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/test/util/FileUtil.java rename to services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/servermock/util/FileUtil.java index 93acf0ba26..c92f8955d0 100644 --- a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/test/util/FileUtil.java +++ b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/servermock/util/FileUtil.java @@ -1,4 +1,4 @@ -package uk.ac.ic.wlgitbridge.test.util; +package uk.ac.ic.wlgitbridge.snapshot.servermock.util; import org.eclipse.jgit.api.Git; import org.eclipse.jgit.api.errors.GitAPIException; diff --git a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/util/Util.java b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/util/Util.java index abc33f14a7..d04e3a83a9 100644 --- a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/util/Util.java +++ b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/util/Util.java @@ -1,7 +1,5 @@ package uk.ac.ic.wlgitbridge.util; -import uk.ac.ic.wlgitbridge.application.SSLConfig; - import java.io.*; import java.text.DateFormat; import java.text.SimpleDateFormat; @@ -17,7 +15,6 @@ public class Util { private static String SERVICE_NAME; private static String HOSTNAME; - private static SSLConfig SSL_CONFIG; private static int PORT; private static String POSTBACK_URL; private static final DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSSSSS"); diff --git a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/model/db/PersistentStoreUpdater.java b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/model/db/PersistentStoreUpdater.java deleted file mode 100644 index 5af44d909a..0000000000 --- a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/writelatex/model/db/PersistentStoreUpdater.java +++ /dev/null @@ -1,10 +0,0 @@ -package uk.ac.ic.wlgitbridge.writelatex.model.db; - -/** - * Created by Winston on 19/11/14. - */ -public interface PersistentStoreUpdater { - - public void updatePersistentStore(PersistentStore persistentStore, T info); - -} diff --git a/services/git-bridge/src/test/java/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest.java b/services/git-bridge/src/test/java/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest.java index 526b1a608a..3d9e99a717 100644 --- a/services/git-bridge/src/test/java/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest.java +++ b/services/git-bridge/src/test/java/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest.java @@ -5,10 +5,10 @@ import org.junit.Rule; import org.junit.Test; import org.junit.rules.TemporaryFolder; import uk.ac.ic.wlgitbridge.application.WLGitBridgeApplication; -import uk.ac.ic.wlgitbridge.test.server.MockSnapshotServer; -import uk.ac.ic.wlgitbridge.test.state.SnapshotAPIState; -import uk.ac.ic.wlgitbridge.test.state.SnapshotAPIStateBuilder; -import uk.ac.ic.wlgitbridge.test.util.FileUtil; +import uk.ac.ic.wlgitbridge.snapshot.servermock.server.MockSnapshotServer; +import uk.ac.ic.wlgitbridge.snapshot.servermock.state.SnapshotAPIState; +import uk.ac.ic.wlgitbridge.snapshot.servermock.state.SnapshotAPIStateBuilder; +import uk.ac.ic.wlgitbridge.snapshot.servermock.util.FileUtil; import uk.ac.ic.wlgitbridge.util.Util; import java.io.*; @@ -151,7 +151,7 @@ public class WLGitBridgeIntegrationTest { } private Path getResource(String path) { - return Paths.get("src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest" + path); + return Paths.get("src/servermock/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest" + path); } private InputStream getResourceAsStream(String path) { diff --git a/services/git-bridge/src/test/java/uk/ac/ic/wlgitbridge/writelatex/model/db/sql/update/delete/DeleteFilesForProjectSQLUpdateTest.java b/services/git-bridge/src/test/java/uk/ac/ic/wlgitbridge/data/model/db/sql/update/delete/DeleteFilesForProjectSQLUpdateTest.java similarity index 85% rename from services/git-bridge/src/test/java/uk/ac/ic/wlgitbridge/writelatex/model/db/sql/update/delete/DeleteFilesForProjectSQLUpdateTest.java rename to services/git-bridge/src/test/java/uk/ac/ic/wlgitbridge/data/model/db/sql/update/delete/DeleteFilesForProjectSQLUpdateTest.java index aad9ab3642..8904e60877 100644 --- a/services/git-bridge/src/test/java/uk/ac/ic/wlgitbridge/writelatex/model/db/sql/update/delete/DeleteFilesForProjectSQLUpdateTest.java +++ b/services/git-bridge/src/test/java/uk/ac/ic/wlgitbridge/data/model/db/sql/update/delete/DeleteFilesForProjectSQLUpdateTest.java @@ -1,4 +1,4 @@ -package uk.ac.ic.wlgitbridge.writelatex.model.db.sql.update.delete; +package uk.ac.ic.wlgitbridge.data.model.db.sql.update.delete; import org.junit.Test; import static org.junit.Assert.*; diff --git a/services/git-bridge/src/test/java/uk/ac/ic/wlgitbridge/test/util/FileUtilTest.java b/services/git-bridge/src/test/java/uk/ac/ic/wlgitbridge/snapshot/servermock/util/FileUtilTest.java similarity index 60% rename from services/git-bridge/src/test/java/uk/ac/ic/wlgitbridge/test/util/FileUtilTest.java rename to services/git-bridge/src/test/java/uk/ac/ic/wlgitbridge/snapshot/servermock/util/FileUtilTest.java index 9181b73a4d..4b26b25640 100644 --- a/services/git-bridge/src/test/java/uk/ac/ic/wlgitbridge/test/util/FileUtilTest.java +++ b/services/git-bridge/src/test/java/uk/ac/ic/wlgitbridge/snapshot/servermock/util/FileUtilTest.java @@ -1,4 +1,4 @@ -package uk.ac.ic.wlgitbridge.test.util; +package uk.ac.ic.wlgitbridge.snapshot.servermock.util; import junit.framework.Assert; import org.junit.Test; @@ -11,50 +11,50 @@ public class FileUtilTest { @Test public void returnsTrueWhenFilesAreEqualInBothDirectories() throws URISyntaxException { - Path eq1 = Paths.get(getClass().getResource("/uk/ac/ic/wlgitbridge/test/util/FileUtilTest/returnsTrueWhenFilesAreEqualInBothDirectories/eq1").toURI()); - Path eq2 = Paths.get(getClass().getResource("/uk/ac/ic/wlgitbridge/test/util/FileUtilTest/returnsTrueWhenFilesAreEqualInBothDirectories/eq2").toURI()); + Path eq1 = Paths.get(getClass().getResource("/uk/ac/ic/wlgitbridge/servermock/util/FileUtilTest/returnsTrueWhenFilesAreEqualInBothDirectories/eq1").toURI()); + Path eq2 = Paths.get(getClass().getResource("/uk/ac/ic/wlgitbridge/servermock/util/FileUtilTest/returnsTrueWhenFilesAreEqualInBothDirectories/eq2").toURI()); Assert.assertTrue(FileUtil.gitDirectoriesAreEqual(eq1, eq2)); } @Test public void returnsTrueWhenRecursiveFilesAreEqualInBothDirectores() throws URISyntaxException { - Path eq1 = Paths.get(getClass().getResource("/uk/ac/ic/wlgitbridge/test/util/FileUtilTest/returnsTrueWhenRecursiveFilesAreEqualInBothDirectories/eq1").toURI()); - Path eq2 = Paths.get(getClass().getResource("/uk/ac/ic/wlgitbridge/test/util/FileUtilTest/returnsTrueWhenRecursiveFilesAreEqualInBothDirectories/eq2").toURI()); + Path eq1 = Paths.get(getClass().getResource("/uk/ac/ic/wlgitbridge/servermock/util/FileUtilTest/returnsTrueWhenRecursiveFilesAreEqualInBothDirectories/eq1").toURI()); + Path eq2 = Paths.get(getClass().getResource("/uk/ac/ic/wlgitbridge/servermock/util/FileUtilTest/returnsTrueWhenRecursiveFilesAreEqualInBothDirectories/eq2").toURI()); Assert.assertTrue(FileUtil.gitDirectoriesAreEqual(eq1, eq2)); } @Test public void returnsFalseWhenFilesAreNotEqualInBothDirectories() throws URISyntaxException { - Path neq1 = Paths.get(getClass().getResource("/uk/ac/ic/wlgitbridge/test/util/FileUtilTest/returnsFalseWhenFilesAreNotEqualInBothDirectories/neq1").toURI()); - Path neq2 = Paths.get(getClass().getResource("/uk/ac/ic/wlgitbridge/test/util/FileUtilTest/returnsFalseWhenFilesAreNotEqualInBothDirectories/neq2").toURI()); + Path neq1 = Paths.get(getClass().getResource("/uk/ac/ic/wlgitbridge/servermock/util/FileUtilTest/returnsFalseWhenFilesAreNotEqualInBothDirectories/neq1").toURI()); + Path neq2 = Paths.get(getClass().getResource("/uk/ac/ic/wlgitbridge/servermock/util/FileUtilTest/returnsFalseWhenFilesAreNotEqualInBothDirectories/neq2").toURI()); Assert.assertFalse(FileUtil.gitDirectoriesAreEqual(neq1, neq2)); } @Test public void returnsFalseWhenRecursiveFilesAreNotEqualInBothDirectories() throws URISyntaxException { - Path neq1 = Paths.get(getClass().getResource("/uk/ac/ic/wlgitbridge/test/util/FileUtilTest/returnsFalseWhenRecursiveFilesAreNotEqualInBothDirectories/neq1").toURI()); - Path neq2 = Paths.get(getClass().getResource("/uk/ac/ic/wlgitbridge/test/util/FileUtilTest/returnsFalseWhenRecursiveFilesAreNotEqualInBothDirectories/neq2").toURI()); + Path neq1 = Paths.get(getClass().getResource("/uk/ac/ic/wlgitbridge/servermock/util/FileUtilTest/returnsFalseWhenRecursiveFilesAreNotEqualInBothDirectories/neq1").toURI()); + Path neq2 = Paths.get(getClass().getResource("/uk/ac/ic/wlgitbridge/servermock/util/FileUtilTest/returnsFalseWhenRecursiveFilesAreNotEqualInBothDirectories/neq2").toURI()); Assert.assertFalse(FileUtil.gitDirectoriesAreEqual(neq1, neq2)); } @Test public void returnsTrueEvenIfGitDirectoriesAreNotEqual() throws URISyntaxException { - Path neq1 = Paths.get(getClass().getResource("/uk/ac/ic/wlgitbridge/test/util/FileUtilTest/returnsTrueEvenIfGitDirectoriesAreNotEqual/eq1").toURI()); - Path neq2 = Paths.get(getClass().getResource("/uk/ac/ic/wlgitbridge/test/util/FileUtilTest/returnsTrueEvenIfGitDirectoriesAreNotEqual/eq2").toURI()); + Path neq1 = Paths.get(getClass().getResource("/uk/ac/ic/wlgitbridge/servermock/util/FileUtilTest/returnsTrueEvenIfGitDirectoriesAreNotEqual/eq1").toURI()); + Path neq2 = Paths.get(getClass().getResource("/uk/ac/ic/wlgitbridge/servermock/util/FileUtilTest/returnsTrueEvenIfGitDirectoriesAreNotEqual/eq2").toURI()); Assert.assertTrue(FileUtil.gitDirectoriesAreEqual(neq1, neq2)); } @Test public void returnsFalseIfFileNamesAreNotEqual() throws URISyntaxException { - Path neq1 = Paths.get(getClass().getResource("/uk/ac/ic/wlgitbridge/test/util/FileUtilTest/returnsFalseIfFileNamesAreNotEqual/neq1").toURI()); - Path neq2 = Paths.get(getClass().getResource("/uk/ac/ic/wlgitbridge/test/util/FileUtilTest/returnsFalseIfFileNamesAreNotEqual/neq2").toURI()); + Path neq1 = Paths.get(getClass().getResource("/uk/ac/ic/wlgitbridge/servermock/util/FileUtilTest/returnsFalseIfFileNamesAreNotEqual/neq1").toURI()); + Path neq2 = Paths.get(getClass().getResource("/uk/ac/ic/wlgitbridge/servermock/util/FileUtilTest/returnsFalseIfFileNamesAreNotEqual/neq2").toURI()); Assert.assertFalse(FileUtil.gitDirectoriesAreEqual(neq1, neq2)); } @Test public void returnsFalseIfInnerDirectoryNamesAreNotEqual() throws URISyntaxException { - Path neq1 = Paths.get(getClass().getResource("/uk/ac/ic/wlgitbridge/test/util/FileUtilTest/returnsFalseIfInnerDirectoryNamesAreNotEqual/neq1").toURI()); - Path neq2 = Paths.get(getClass().getResource("/uk/ac/ic/wlgitbridge/test/util/FileUtilTest/returnsFalseIfInnerDirectoryNamesAreNotEqual/neq2").toURI()); + Path neq1 = Paths.get(getClass().getResource("/uk/ac/ic/wlgitbridge/servermock/util/FileUtilTest/returnsFalseIfInnerDirectoryNamesAreNotEqual/neq1").toURI()); + Path neq2 = Paths.get(getClass().getResource("/uk/ac/ic/wlgitbridge/servermock/util/FileUtilTest/returnsFalseIfInnerDirectoryNamesAreNotEqual/neq2").toURI()); Assert.assertFalse(FileUtil.gitDirectoriesAreEqual(neq1, neq2)); } diff --git a/services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/test/util/FileUtilTest/returnsFalseIfFileNamesAreNotEqual/neq1/file.txt b/services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/snapshot/servermock/util/FileUtilTest/returnsFalseIfFileNamesAreNotEqual/neq1/file.txt similarity index 100% rename from services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/test/util/FileUtilTest/returnsFalseIfFileNamesAreNotEqual/neq1/file.txt rename to services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/snapshot/servermock/util/FileUtilTest/returnsFalseIfFileNamesAreNotEqual/neq1/file.txt diff --git a/services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/test/util/FileUtilTest/returnsFalseIfFileNamesAreNotEqual/neq1/neq1.txt b/services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/snapshot/servermock/util/FileUtilTest/returnsFalseIfFileNamesAreNotEqual/neq1/neq1.txt similarity index 100% rename from services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/test/util/FileUtilTest/returnsFalseIfFileNamesAreNotEqual/neq1/neq1.txt rename to services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/snapshot/servermock/util/FileUtilTest/returnsFalseIfFileNamesAreNotEqual/neq1/neq1.txt diff --git a/services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/test/util/FileUtilTest/returnsFalseIfFileNamesAreNotEqual/neq2/file.txt b/services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/snapshot/servermock/util/FileUtilTest/returnsFalseIfFileNamesAreNotEqual/neq2/file.txt similarity index 100% rename from services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/test/util/FileUtilTest/returnsFalseIfFileNamesAreNotEqual/neq2/file.txt rename to services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/snapshot/servermock/util/FileUtilTest/returnsFalseIfFileNamesAreNotEqual/neq2/file.txt diff --git a/services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/test/util/FileUtilTest/returnsFalseIfFileNamesAreNotEqual/neq2/neq2.txt b/services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/snapshot/servermock/util/FileUtilTest/returnsFalseIfFileNamesAreNotEqual/neq2/neq2.txt similarity index 100% rename from services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/test/util/FileUtilTest/returnsFalseIfFileNamesAreNotEqual/neq2/neq2.txt rename to services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/snapshot/servermock/util/FileUtilTest/returnsFalseIfFileNamesAreNotEqual/neq2/neq2.txt diff --git a/services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/test/util/FileUtilTest/returnsFalseIfInnerDirectoryNamesAreNotEqual/neq1/neq1/file.txt b/services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/snapshot/servermock/util/FileUtilTest/returnsFalseIfInnerDirectoryNamesAreNotEqual/neq1/neq1/file.txt similarity index 100% rename from services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/test/util/FileUtilTest/returnsFalseIfInnerDirectoryNamesAreNotEqual/neq1/neq1/file.txt rename to services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/snapshot/servermock/util/FileUtilTest/returnsFalseIfInnerDirectoryNamesAreNotEqual/neq1/neq1/file.txt diff --git a/services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/test/util/FileUtilTest/returnsFalseIfInnerDirectoryNamesAreNotEqual/neq2/neq2/file.txt b/services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/snapshot/servermock/util/FileUtilTest/returnsFalseIfInnerDirectoryNamesAreNotEqual/neq2/neq2/file.txt similarity index 100% rename from services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/test/util/FileUtilTest/returnsFalseIfInnerDirectoryNamesAreNotEqual/neq2/neq2/file.txt rename to services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/snapshot/servermock/util/FileUtilTest/returnsFalseIfInnerDirectoryNamesAreNotEqual/neq2/neq2/file.txt diff --git a/services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/test/util/FileUtilTest/returnsFalseWhenFilesAreNotEqualInBothDirectories/neq1/file.txt b/services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/snapshot/servermock/util/FileUtilTest/returnsFalseWhenFilesAreNotEqualInBothDirectories/neq1/file.txt similarity index 100% rename from services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/test/util/FileUtilTest/returnsFalseWhenFilesAreNotEqualInBothDirectories/neq1/file.txt rename to services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/snapshot/servermock/util/FileUtilTest/returnsFalseWhenFilesAreNotEqualInBothDirectories/neq1/file.txt diff --git a/services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/test/util/FileUtilTest/returnsFalseWhenFilesAreNotEqualInBothDirectories/neq2/file.txt b/services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/snapshot/servermock/util/FileUtilTest/returnsFalseWhenFilesAreNotEqualInBothDirectories/neq2/file.txt similarity index 100% rename from services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/test/util/FileUtilTest/returnsFalseWhenFilesAreNotEqualInBothDirectories/neq2/file.txt rename to services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/snapshot/servermock/util/FileUtilTest/returnsFalseWhenFilesAreNotEqualInBothDirectories/neq2/file.txt diff --git a/services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/test/util/FileUtilTest/returnsFalseWhenRecursiveFilesAreNotEqualInBothDirectories/neq1/dir/file.txt b/services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/snapshot/servermock/util/FileUtilTest/returnsFalseWhenRecursiveFilesAreNotEqualInBothDirectories/neq1/dir/file.txt similarity index 100% rename from services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/test/util/FileUtilTest/returnsFalseWhenRecursiveFilesAreNotEqualInBothDirectories/neq1/dir/file.txt rename to services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/snapshot/servermock/util/FileUtilTest/returnsFalseWhenRecursiveFilesAreNotEqualInBothDirectories/neq1/dir/file.txt diff --git a/services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/test/util/FileUtilTest/returnsFalseWhenRecursiveFilesAreNotEqualInBothDirectories/neq1/file.txt b/services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/snapshot/servermock/util/FileUtilTest/returnsFalseWhenRecursiveFilesAreNotEqualInBothDirectories/neq1/file.txt similarity index 100% rename from services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/test/util/FileUtilTest/returnsFalseWhenRecursiveFilesAreNotEqualInBothDirectories/neq1/file.txt rename to services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/snapshot/servermock/util/FileUtilTest/returnsFalseWhenRecursiveFilesAreNotEqualInBothDirectories/neq1/file.txt diff --git a/services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/test/util/FileUtilTest/returnsFalseWhenRecursiveFilesAreNotEqualInBothDirectories/neq2/dir/file.txt b/services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/snapshot/servermock/util/FileUtilTest/returnsFalseWhenRecursiveFilesAreNotEqualInBothDirectories/neq2/dir/file.txt similarity index 100% rename from services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/test/util/FileUtilTest/returnsFalseWhenRecursiveFilesAreNotEqualInBothDirectories/neq2/dir/file.txt rename to services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/snapshot/servermock/util/FileUtilTest/returnsFalseWhenRecursiveFilesAreNotEqualInBothDirectories/neq2/dir/file.txt diff --git a/services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/test/util/FileUtilTest/returnsFalseWhenRecursiveFilesAreNotEqualInBothDirectories/neq2/file.txt b/services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/snapshot/servermock/util/FileUtilTest/returnsFalseWhenRecursiveFilesAreNotEqualInBothDirectories/neq2/file.txt similarity index 100% rename from services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/test/util/FileUtilTest/returnsFalseWhenRecursiveFilesAreNotEqualInBothDirectories/neq2/file.txt rename to services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/snapshot/servermock/util/FileUtilTest/returnsFalseWhenRecursiveFilesAreNotEqualInBothDirectories/neq2/file.txt diff --git a/services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/test/util/FileUtilTest/returnsTrueEvenIfGitDirectoriesAreNotEqual/eq1/dir/file.txt b/services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/snapshot/servermock/util/FileUtilTest/returnsTrueEvenIfGitDirectoriesAreNotEqual/eq1/dir/file.txt similarity index 100% rename from services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/test/util/FileUtilTest/returnsTrueEvenIfGitDirectoriesAreNotEqual/eq1/dir/file.txt rename to services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/snapshot/servermock/util/FileUtilTest/returnsTrueEvenIfGitDirectoriesAreNotEqual/eq1/dir/file.txt diff --git a/services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/test/util/FileUtilTest/returnsTrueEvenIfGitDirectoriesAreNotEqual/eq1/file.txt b/services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/snapshot/servermock/util/FileUtilTest/returnsTrueEvenIfGitDirectoriesAreNotEqual/eq1/file.txt similarity index 100% rename from services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/test/util/FileUtilTest/returnsTrueEvenIfGitDirectoriesAreNotEqual/eq1/file.txt rename to services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/snapshot/servermock/util/FileUtilTest/returnsTrueEvenIfGitDirectoriesAreNotEqual/eq1/file.txt diff --git a/services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/test/util/FileUtilTest/returnsTrueEvenIfGitDirectoriesAreNotEqual/eq2/dir/file.txt b/services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/snapshot/servermock/util/FileUtilTest/returnsTrueEvenIfGitDirectoriesAreNotEqual/eq2/dir/file.txt similarity index 100% rename from services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/test/util/FileUtilTest/returnsTrueEvenIfGitDirectoriesAreNotEqual/eq2/dir/file.txt rename to services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/snapshot/servermock/util/FileUtilTest/returnsTrueEvenIfGitDirectoriesAreNotEqual/eq2/dir/file.txt diff --git a/services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/test/util/FileUtilTest/returnsTrueEvenIfGitDirectoriesAreNotEqual/eq2/file.txt b/services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/snapshot/servermock/util/FileUtilTest/returnsTrueEvenIfGitDirectoriesAreNotEqual/eq2/file.txt similarity index 100% rename from services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/test/util/FileUtilTest/returnsTrueEvenIfGitDirectoriesAreNotEqual/eq2/file.txt rename to services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/snapshot/servermock/util/FileUtilTest/returnsTrueEvenIfGitDirectoriesAreNotEqual/eq2/file.txt diff --git a/services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/test/util/FileUtilTest/returnsTrueWhenFilesAreEqualInBothDirectories/eq1/file.txt b/services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/snapshot/servermock/util/FileUtilTest/returnsTrueWhenFilesAreEqualInBothDirectories/eq1/file.txt similarity index 100% rename from services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/test/util/FileUtilTest/returnsTrueWhenFilesAreEqualInBothDirectories/eq1/file.txt rename to services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/snapshot/servermock/util/FileUtilTest/returnsTrueWhenFilesAreEqualInBothDirectories/eq1/file.txt diff --git a/services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/test/util/FileUtilTest/returnsTrueWhenFilesAreEqualInBothDirectories/eq2/file.txt b/services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/snapshot/servermock/util/FileUtilTest/returnsTrueWhenFilesAreEqualInBothDirectories/eq2/file.txt similarity index 100% rename from services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/test/util/FileUtilTest/returnsTrueWhenFilesAreEqualInBothDirectories/eq2/file.txt rename to services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/snapshot/servermock/util/FileUtilTest/returnsTrueWhenFilesAreEqualInBothDirectories/eq2/file.txt diff --git a/services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/test/util/FileUtilTest/returnsTrueWhenRecursiveFilesAreEqualInBothDirectories/eq1/dir/file.txt b/services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/snapshot/servermock/util/FileUtilTest/returnsTrueWhenRecursiveFilesAreEqualInBothDirectories/eq1/dir/file.txt similarity index 100% rename from services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/test/util/FileUtilTest/returnsTrueWhenRecursiveFilesAreEqualInBothDirectories/eq1/dir/file.txt rename to services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/snapshot/servermock/util/FileUtilTest/returnsTrueWhenRecursiveFilesAreEqualInBothDirectories/eq1/dir/file.txt diff --git a/services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/test/util/FileUtilTest/returnsTrueWhenRecursiveFilesAreEqualInBothDirectories/eq1/file.txt b/services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/snapshot/servermock/util/FileUtilTest/returnsTrueWhenRecursiveFilesAreEqualInBothDirectories/eq1/file.txt similarity index 100% rename from services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/test/util/FileUtilTest/returnsTrueWhenRecursiveFilesAreEqualInBothDirectories/eq1/file.txt rename to services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/snapshot/servermock/util/FileUtilTest/returnsTrueWhenRecursiveFilesAreEqualInBothDirectories/eq1/file.txt diff --git a/services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/test/util/FileUtilTest/returnsTrueWhenRecursiveFilesAreEqualInBothDirectories/eq2/dir/file.txt b/services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/snapshot/servermock/util/FileUtilTest/returnsTrueWhenRecursiveFilesAreEqualInBothDirectories/eq2/dir/file.txt similarity index 100% rename from services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/test/util/FileUtilTest/returnsTrueWhenRecursiveFilesAreEqualInBothDirectories/eq2/dir/file.txt rename to services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/snapshot/servermock/util/FileUtilTest/returnsTrueWhenRecursiveFilesAreEqualInBothDirectories/eq2/dir/file.txt diff --git a/services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/test/util/FileUtilTest/returnsTrueWhenRecursiveFilesAreEqualInBothDirectories/eq2/file.txt b/services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/snapshot/servermock/util/FileUtilTest/returnsTrueWhenRecursiveFilesAreEqualInBothDirectories/eq2/file.txt similarity index 100% rename from services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/test/util/FileUtilTest/returnsTrueWhenRecursiveFilesAreEqualInBothDirectories/eq2/file.txt rename to services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/snapshot/servermock/util/FileUtilTest/returnsTrueWhenRecursiveFilesAreEqualInBothDirectories/eq2/file.txt diff --git a/services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/test/util/FileUtilTest/returnsFalseWhenCommitsAreDifferent/neq1 b/services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/test/util/FileUtilTest/returnsFalseWhenCommitsAreDifferent/neq1 deleted file mode 160000 index a970b70202..0000000000 --- a/services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/test/util/FileUtilTest/returnsFalseWhenCommitsAreDifferent/neq1 +++ /dev/null @@ -1 +0,0 @@ -Subproject commit a970b70202d8df99e0b42a0498e5df3070976493 diff --git a/services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/test/util/FileUtilTest/returnsFalseWhenCommitsAreDifferent/neq2 b/services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/test/util/FileUtilTest/returnsFalseWhenCommitsAreDifferent/neq2 deleted file mode 160000 index e2ed297a27..0000000000 --- a/services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/test/util/FileUtilTest/returnsFalseWhenCommitsAreDifferent/neq2 +++ /dev/null @@ -1 +0,0 @@ -Subproject commit e2ed297a2717598c89ec0b54fe9f748a15509d3b diff --git a/services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/test/util/FileUtilTest/returnsTrueWhenCommitsAreTheSame/eq1 b/services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/test/util/FileUtilTest/returnsTrueWhenCommitsAreTheSame/eq1 deleted file mode 160000 index f5ae5f4aaa..0000000000 --- a/services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/test/util/FileUtilTest/returnsTrueWhenCommitsAreTheSame/eq1 +++ /dev/null @@ -1 +0,0 @@ -Subproject commit f5ae5f4aaa838d152da1c1154c199c71e1623188 diff --git a/services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/test/util/FileUtilTest/returnsTrueWhenCommitsAreTheSame/eq2 b/services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/test/util/FileUtilTest/returnsTrueWhenCommitsAreTheSame/eq2 deleted file mode 160000 index f5ae5f4aaa..0000000000 --- a/services/git-bridge/src/test/resources/uk/ac/ic/wlgitbridge/test/util/FileUtilTest/returnsTrueWhenCommitsAreTheSame/eq2 +++ /dev/null @@ -1 +0,0 @@ -Subproject commit f5ae5f4aaa838d152da1c1154c199c71e1623188