refractor exception -> localexception
flavien's git/Projet_JAVA_P2P_STRI2A/pipeline/head This commit looks good Details

pull/47/head
Flavien Haas 5 years ago
parent 750788c1b3
commit 740e25546a

@ -6,22 +6,22 @@ import protocolP2P.ProtocolP2PPacketTCP;
import protocolP2P.Payload; import protocolP2P.Payload;
import protocolP2P.LoadRequest; import protocolP2P.LoadRequest;
import protocolP2P.FilePart; import protocolP2P.FilePart;
import exception.InternalError; import localException.InternalError;
import remoteException.EmptyDirectory; import remoteException.EmptyDirectory;
import remoteException.EmptyFile; import remoteException.EmptyFile;
import exception.ProtocolError; import localException.ProtocolError;
import remoteException.InternalRemoteError; import remoteException.InternalRemoteError;
import remoteException.VersionRemoteError; import remoteException.VersionRemoteError;
import exception.TransmissionError; import localException.TransmissionError;
import remoteException.ProtocolRemoteError; import remoteException.ProtocolRemoteError;
import exception.VersionError; import localException.VersionError;
import exception.SizeError; import localException.SizeError;
import remoteException.NotFound; import remoteException.NotFound;
import java.nio.file.Files; import java.nio.file.Files;
import java.io.File; import java.io.File;
import java.nio.file.Paths; import java.nio.file.Paths;
import java.io.IOException; import java.io.IOException;
import exception.SocketClosed; import localException.SocketClosed;
/** Class to download file parts on tcp. /** Class to download file parts on tcp.
* @author Louis Royer * @author Louis Royer

@ -6,16 +6,16 @@ import protocolP2P.ProtocolP2PPacketUDP;
import protocolP2P.Payload; import protocolP2P.Payload;
import protocolP2P.LoadRequest; import protocolP2P.LoadRequest;
import protocolP2P.FilePart; import protocolP2P.FilePart;
import exception.InternalError; import localException.InternalError;
import remoteException.EmptyDirectory; import remoteException.EmptyDirectory;
import remoteException.EmptyFile; import remoteException.EmptyFile;
import exception.ProtocolError; import localException.ProtocolError;
import remoteException.InternalRemoteError; import remoteException.InternalRemoteError;
import remoteException.VersionRemoteError; import remoteException.VersionRemoteError;
import exception.TransmissionError; import localException.TransmissionError;
import remoteException.ProtocolRemoteError; import remoteException.ProtocolRemoteError;
import exception.VersionError; import localException.VersionError;
import exception.SizeError; import localException.SizeError;
import remoteException.NotFound; import remoteException.NotFound;
import java.nio.file.Files; import java.nio.file.Files;
import java.io.File; import java.io.File;

@ -16,11 +16,11 @@ import protocolP2P.HashResponse;
import protocolP2P.HashRequest; import protocolP2P.HashRequest;
import protocolP2P.ProtocolP2PPacketTCP; import protocolP2P.ProtocolP2PPacketTCP;
import protocolP2P.Payload; import protocolP2P.Payload;
import exception.ProtocolError; import localException.ProtocolError;
import exception.InternalError; import localException.InternalError;
import exception.TransmissionError; import localException.TransmissionError;
import exception.SizeError; import localException.SizeError;
import exception.VersionError; import localException.VersionError;
import protocolP2P.FilePart; import protocolP2P.FilePart;
import protocolP2P.LoadRequest; import protocolP2P.LoadRequest;
import java.io.IOException; import java.io.IOException;
@ -29,7 +29,7 @@ import java.io.File;
import java.nio.file.Paths; import java.nio.file.Paths;
import java.nio.file.StandardOpenOption; import java.nio.file.StandardOpenOption;
import java.nio.file.StandardCopyOption; import java.nio.file.StandardCopyOption;
import exception.SocketClosed; import localException.SocketClosed;
/** Class to download file from tcp /** Class to download file from tcp
* @author Louis Royer * @author Louis Royer

@ -16,11 +16,11 @@ import protocolP2P.HashResponse;
import protocolP2P.HashRequest; import protocolP2P.HashRequest;
import protocolP2P.ProtocolP2PPacketUDP; import protocolP2P.ProtocolP2PPacketUDP;
import protocolP2P.Payload; import protocolP2P.Payload;
import exception.ProtocolError; import localException.ProtocolError;
import exception.InternalError; import localException.InternalError;
import exception.TransmissionError; import localException.TransmissionError;
import exception.SizeError; import localException.SizeError;
import exception.VersionError; import localException.VersionError;
import protocolP2P.FilePart; import protocolP2P.FilePart;
import protocolP2P.LoadRequest; import protocolP2P.LoadRequest;
import java.io.IOException; import java.io.IOException;

@ -1,9 +1,9 @@
package clientP2P; package clientP2P;
import exception.InternalError; import localException.InternalError;
import exception.ProtocolError; import localException.ProtocolError;
import exception.SizeError; import localException.SizeError;
import exception.TransmissionError; import localException.TransmissionError;
import exception.VersionError; import localException.VersionError;
import remoteException.EmptyFile; import remoteException.EmptyFile;
import remoteException.EmptyDirectory; import remoteException.EmptyDirectory;
import remoteException.InternalRemoteError; import remoteException.InternalRemoteError;
@ -34,7 +34,7 @@ import protocolP2P.HashResponse;
import java.security.MessageDigest; import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException; import java.security.NoSuchAlgorithmException;
import clientP2P.ClientDownloadTCP; import clientP2P.ClientDownloadTCP;
import exception.SocketClosed; import localException.SocketClosed;
/** Implementation of P2P-JAVA-PROJECT CLIENT /** Implementation of P2P-JAVA-PROJECT CLIENT
* @author Louis Royer * @author Louis Royer

@ -1,9 +1,9 @@
package clientP2P; package clientP2P;
import exception.InternalError; import localException.InternalError;
import exception.ProtocolError; import localException.ProtocolError;
import exception.SizeError; import localException.SizeError;
import exception.TransmissionError; import localException.TransmissionError;
import exception.VersionError; import localException.VersionError;
import remoteException.EmptyFile; import remoteException.EmptyFile;
import remoteException.EmptyDirectory; import remoteException.EmptyDirectory;
import remoteException.InternalRemoteError; import remoteException.InternalRemoteError;

@ -1,4 +1,4 @@
package exception; package localException;
public class InternalError extends Exception { public class InternalError extends Exception {
private static final long serialVersionUID = 12L; private static final long serialVersionUID = 12L;
} }

@ -1,4 +1,4 @@
package exception; package localException;
public class ProtocolError extends Exception { public class ProtocolError extends Exception {
private static final long serialVersionUID = 12L; private static final long serialVersionUID = 12L;
} }

@ -1,4 +1,4 @@
package exception; package localException;
/** Used on reception side when size as set in Packet is too big, and we cant store this in a int/long as usual. */ /** Used on reception side when size as set in Packet is too big, and we cant store this in a int/long as usual. */
public class SizeError extends Exception { public class SizeError extends Exception {
private static final long serialVersionUID = 12L; private static final long serialVersionUID = 12L;

@ -1,4 +1,4 @@
package exception; package localException;
public class SocketClosed extends Exception { public class SocketClosed extends Exception {
private static final long serialVersionUID = 12L; private static final long serialVersionUID = 12L;
} }

@ -1,4 +1,4 @@
package exception; package localException;
public class TransmissionError extends Exception { public class TransmissionError extends Exception {
private static final long serialVersionUID = 12L; private static final long serialVersionUID = 12L;
} }

@ -1,4 +1,4 @@
package exception; package localException;
public class VersionError extends Exception { public class VersionError extends Exception {
private static final long serialVersionUID = 12L; private static final long serialVersionUID = 12L;
} }

@ -2,10 +2,10 @@ package protocolP2P;
import java.util.Arrays; import java.util.Arrays;
import protocolP2P.Payload; import protocolP2P.Payload;
import protocolP2P.RequestResponseCode; import protocolP2P.RequestResponseCode;
import exception.TransmissionError; import localException.TransmissionError;
import exception.ProtocolError; import localException.ProtocolError;
import exception.InternalError; import localException.InternalError;
import exception.SizeError; import localException.SizeError;
import java.io.UnsupportedEncodingException; import java.io.UnsupportedEncodingException;
import tools.BytesArrayTools; import tools.BytesArrayTools;

@ -1,10 +1,10 @@
package protocolP2P; package protocolP2P;
import protocolP2P.Payload; import protocolP2P.Payload;
import protocolP2P.RequestResponseCode; import protocolP2P.RequestResponseCode;
import exception.ProtocolError; import localException.ProtocolError;
import exception.InternalError; import localException.InternalError;
import exception.SizeError; import localException.SizeError;
import exception.TransmissionError; import localException.TransmissionError;
import tools.BytesArrayTools; import tools.BytesArrayTools;
import java.util.Arrays; import java.util.Arrays;
import java.io.UnsupportedEncodingException; import java.io.UnsupportedEncodingException;

@ -2,10 +2,10 @@ package protocolP2P;
import protocolP2P.Payload; import protocolP2P.Payload;
import protocolP2P.HashAlgorithm; import protocolP2P.HashAlgorithm;
import java.io.UnsupportedEncodingException; import java.io.UnsupportedEncodingException;
import exception.TransmissionError; import localException.TransmissionError;
import exception.SizeError; import localException.SizeError;
import exception.ProtocolError; import localException.ProtocolError;
import exception.InternalError; import localException.InternalError;
import tools.BytesArrayTools; import tools.BytesArrayTools;

@ -3,10 +3,10 @@ import protocolP2P.Payload;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
import java.io.UnsupportedEncodingException; import java.io.UnsupportedEncodingException;
import exception.TransmissionError; import localException.TransmissionError;
import exception.SizeError; import localException.SizeError;
import exception.ProtocolError; import localException.ProtocolError;
import exception.InternalError; import localException.InternalError;
import tools.BytesArrayTools; import tools.BytesArrayTools;

@ -1,10 +1,10 @@
package protocolP2P; package protocolP2P;
import protocolP2P.Payload; import protocolP2P.Payload;
import protocolP2P.RequestResponseCode; import protocolP2P.RequestResponseCode;
import exception.TransmissionError; import localException.TransmissionError;
import exception.ProtocolError; import localException.ProtocolError;
import exception.InternalError; import localException.InternalError;
import exception.SizeError; import localException.SizeError;
import tools.BytesArrayTools; import tools.BytesArrayTools;
import java.io.UnsupportedEncodingException; import java.io.UnsupportedEncodingException;

@ -5,10 +5,10 @@ import protocolP2P.FileList;
import protocolP2P.LoadRequest; import protocolP2P.LoadRequest;
import protocolP2P.HashRequest; import protocolP2P.HashRequest;
import protocolP2P.HashResponse; import protocolP2P.HashResponse;
import exception.ProtocolError; import localException.ProtocolError;
import exception.InternalError; import localException.InternalError;
import exception.TransmissionError; import localException.TransmissionError;
import exception.SizeError; import localException.SizeError;
import tools.BytesArrayTools; import tools.BytesArrayTools;
/** Representation of payload. If payload has a size, use subclasses instead. /** Representation of payload. If payload has a size, use subclasses instead.
* @author Louis Royer * @author Louis Royer

@ -1,10 +1,10 @@
package protocolP2P; package protocolP2P;
import exception.InternalError; import localException.InternalError;
import exception.ProtocolError; import localException.ProtocolError;
import exception.SizeError; import localException.SizeError;
import exception.TransmissionError; import localException.TransmissionError;
import exception.VersionError; import localException.VersionError;
import exception.SocketClosed; import localException.SocketClosed;
import remoteException.EmptyDirectory; import remoteException.EmptyDirectory;
import remoteException.InternalRemoteError; import remoteException.InternalRemoteError;
import remoteException.NotFound; import remoteException.NotFound;

@ -1,10 +1,10 @@
package protocolP2P; package protocolP2P;
import exception.InternalError; import localException.InternalError;
import exception.ProtocolError; import localException.ProtocolError;
import exception.SizeError; import localException.SizeError;
import exception.TransmissionError; import localException.TransmissionError;
import exception.VersionError; import localException.VersionError;
import exception.SocketClosed; import localException.SocketClosed;
import remoteException.EmptyDirectory; import remoteException.EmptyDirectory;
import remoteException.InternalRemoteError; import remoteException.InternalRemoteError;
import remoteException.NotFound; import remoteException.NotFound;

@ -1,10 +1,10 @@
package protocolP2P; package protocolP2P;
import exception.InternalError; import localException.InternalError;
import exception.ProtocolError; import localException.ProtocolError;
import exception.SizeError; import localException.SizeError;
import exception.TransmissionError; import localException.TransmissionError;
import exception.VersionError; import localException.VersionError;
import exception.SocketClosed; import localException.SocketClosed;
import remoteException.EmptyDirectory; import remoteException.EmptyDirectory;
import remoteException.InternalRemoteError; import remoteException.InternalRemoteError;
import remoteException.NotFound; import remoteException.NotFound;

@ -1,6 +1,6 @@
package protocolP2P; package protocolP2P;
import protocolP2P.CodeType; import protocolP2P.CodeType;
import exception.ProtocolError; import localException.ProtocolError;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
import java.lang.Byte; import java.lang.Byte;
@ -64,5 +64,3 @@ public enum RequestResponseCode {
} }

@ -17,12 +17,12 @@ import protocolP2P.Payload;
import protocolP2P.LoadRequest; import protocolP2P.LoadRequest;
import protocolP2P.FileList; import protocolP2P.FileList;
import protocolP2P.FilePart; import protocolP2P.FilePart;
import exception.InternalError; import localException.InternalError;
import exception.ProtocolError; import localException.ProtocolError;
import exception.SizeError; import localException.SizeError;
import exception.TransmissionError; import localException.TransmissionError;
import exception.VersionError; import localException.VersionError;
import exception.SocketClosed; import localException.SocketClosed;
import remoteException.EmptyDirectory; import remoteException.EmptyDirectory;
import remoteException.InternalRemoteError; import remoteException.InternalRemoteError;
import remoteException.NotFound; import remoteException.NotFound;

@ -16,12 +16,12 @@ import protocolP2P.Payload;
import protocolP2P.LoadRequest; import protocolP2P.LoadRequest;
import protocolP2P.FileList; import protocolP2P.FileList;
import protocolP2P.FilePart; import protocolP2P.FilePart;
import exception.InternalError; import localException.InternalError;
import exception.ProtocolError; import localException.ProtocolError;
import exception.SizeError; import localException.SizeError;
import exception.TransmissionError; import localException.TransmissionError;
import exception.VersionError; import localException.VersionError;
import exception.SocketClosed; import localException.SocketClosed;
import remoteException.EmptyDirectory; import remoteException.EmptyDirectory;
import remoteException.InternalRemoteError; import remoteException.InternalRemoteError;
import remoteException.NotFound; import remoteException.NotFound;
@ -245,4 +245,3 @@ public class ServerManagementUDP implements Runnable {
} }
} }

@ -1,6 +1,6 @@
package tools; package tools;
import exception.SizeError; import localException.SizeError;
import exception.ProtocolError; import localException.ProtocolError;
import java.io.UnsupportedEncodingException; import java.io.UnsupportedEncodingException;
import java.util.Arrays; import java.util.Arrays;

Loading…
Cancel
Save