admin
2024-10-15 6d313a4a6f9f9d7ea65ec50ab0d4491e595edb97
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
package com.jcdm.common.exception.file;
 
import java.io.PrintStream;
import java.io.PrintWriter;
 
/**
 * 文件上传异常类
 * 
 * @author jc
 */
public class FileUploadException extends Exception
{
 
    private static final long serialVersionUID = 1L;
 
    private final Throwable cause;
 
    public FileUploadException()
    {
        this(null, null);
    }
 
    public FileUploadException(final String msg)
    {
        this(msg, null);
    }
 
    public FileUploadException(String msg, Throwable cause)
    {
        super(msg);
        this.cause = cause;
    }
 
    @Override
    public void printStackTrace(PrintStream stream)
    {
        super.printStackTrace(stream);
        if (cause != null)
        {
            stream.println("Caused by:");
            cause.printStackTrace(stream);
        }
    }
 
    @Override
    public void printStackTrace(PrintWriter writer)
    {
        super.printStackTrace(writer);
        if (cause != null)
        {
            writer.println("Caused by:");
            cause.printStackTrace(writer);
        }
    }
 
    @Override
    public Throwable getCause()
    {
        return cause;
    }
}