001    /**
002     * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portlet.documentlibrary.exception;
016    
017    import com.liferay.portal.exception.NoSuchModelException;
018    
019    /**
020     * @author Brian Wing Shun Chan
021     */
022    public class NoSuchFileException extends NoSuchModelException {
023    
024            public NoSuchFileException() {
025            }
026    
027            public NoSuchFileException(
028                    long companyId, long repositoryId, String fileName) {
029    
030                    super(
031                            String.format(
032                                    "{companyId=%s, repositoryId=%s, fileName=%s}", companyId,
033                                    repositoryId, fileName));
034            }
035    
036            public NoSuchFileException(
037                    long companyId, long repositoryId, String fileName, String version) {
038    
039                    super(
040                            String.format(
041                                    "{companyId=%s, repositoryId=%s, fileName=%s, version=%s}",
042                                    companyId, repositoryId, fileName, version));
043            }
044    
045            public NoSuchFileException(
046                    long companyId, long repositoryId, String fileName, String version,
047                    Throwable cause) {
048    
049                    super(
050                            String.format(
051                                    "{companyId=%s, repositoryId=%s, fileName=%s, version=%s, " +
052                                            "cause=%s}",
053                                    companyId, repositoryId, fileName, version, cause),
054                            cause);
055            }
056    
057            public NoSuchFileException(
058                    long companyId, long repositoryId, String fileName, Throwable cause) {
059    
060                    super(
061                            String.format(
062                                    "{companyId=%s, repositoryId=%s, fileName=%s, cause=%s}",
063                                    companyId, repositoryId, fileName, cause),
064                            cause);
065            }
066    
067            public NoSuchFileException(String msg) {
068                    super(msg);
069            }
070    
071            public NoSuchFileException(String msg, Throwable cause) {
072                    super(msg, cause);
073            }
074    
075            public NoSuchFileException(Throwable cause) {
076                    super(cause);
077            }
078    
079    }