Added license

This commit is contained in:
Dave
2014-12-21 00:13:27 +02:00
parent 335b20ac69
commit bce0155abe
31 changed files with 746 additions and 59 deletions

View File

@@ -1,3 +1,22 @@
/*
* Copyright 2014 David Horscroft
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* The NoCore class is the interface between which the wrapper application
* (wrapplication?) accesses no- functionality.
*/
package nodash.core;
import java.io.File;
@@ -6,7 +25,7 @@ import java.security.PublicKey;
import nodash.core.spheres.NoByteSetSphere;
import nodash.core.spheres.NoHashSphere;
import nodash.core.spheres.NoSessionSphere;
import nodash.exceptions.NoDashSessionBadUUID;
import nodash.exceptions.NoDashSessionBadUUIDException;
import nodash.exceptions.NoSessionAlreadyAwaitingConfirmationException;
import nodash.exceptions.NoSessionConfirmedException;
import nodash.exceptions.NoSessionExpiredException;
@@ -43,24 +62,24 @@ public final class NoCore {
return NoSessionSphere.registerUser(user, password);
}
public static NoUser getUser(byte[] cookie) throws NoSessionExpiredException, NoSessionConfirmedException, NoDashSessionBadUUID {
public static NoUser getUser(byte[] cookie) throws NoSessionExpiredException, NoSessionConfirmedException, NoDashSessionBadUUIDException {
/* Facilitates step 3
* allow website-side modifications to the NoUser or NoUser inheritant */
return NoSessionSphere.getUser(cookie);
}
public static NoState getSessionState(byte[] cookie) throws NoSessionExpiredException, NoSessionConfirmedException, NoDashSessionBadUUID {
public static NoState getSessionState(byte[] cookie) throws NoSessionExpiredException, NoSessionConfirmedException, NoDashSessionBadUUIDException {
/* Facilitates step 3
* allow front-side to keep track of session state */
return NoSessionSphere.getState(cookie);
}
public static byte[] requestSave(byte[] cookie, char[] password) throws NoSessionExpiredException, NoSessionConfirmedException, NoSessionNotChangedException, NoSessionAlreadyAwaitingConfirmationException, NoDashSessionBadUUID {
public static byte[] requestSave(byte[] cookie, char[] password) throws NoSessionExpiredException, NoSessionConfirmedException, NoSessionNotChangedException, NoSessionAlreadyAwaitingConfirmationException, NoDashSessionBadUUIDException {
/* Step 4. Provides a user with the new binary file */
return NoSessionSphere.save(cookie, password);
}
public static void confirm(byte[] cookie, char[] password, byte[] data) throws NoSessionExpiredException, NoSessionConfirmedException, NoSessionNotAwaitingConfirmationException, NoUserNotValidException, NoDashSessionBadUUID {
public static void confirm(byte[] cookie, char[] password, byte[] data) throws NoSessionExpiredException, NoSessionConfirmedException, NoSessionNotAwaitingConfirmationException, NoUserNotValidException, NoDashSessionBadUUIDException {
/* Step 5. Assumes the user has re-uploaded the file along with providing the same password.
* Further attempts of getUser or getSessionState will fail with a NoSessionExpiredException*/
NoSessionSphere.confirm(cookie, password, data);