1 /***
2 * Copyright 2007 the original author or authors.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * For more information visit
11 * http://72miles.com and
12 * http://architecturerules.googlecode.com/svn/docs/index.html
13 */
14
15 package com.seventytwomiles.architecturerules.exceptions;
16
17
18 /***
19 * <p>Exception to be thrown when no packages are found in the given source path
20 * if <samp><sources no-packages="exception"> </samp></p>
21 *
22 * @author mikenereson
23 * @see ArchitectureException
24 */
25 public class NoPackagesFoundException extends ArchitectureException {
26
27
28 /***
29 * @see RuntimeException#RuntimeException()
30 */
31 public NoPackagesFoundException() {
32 super("no packages found");
33 }
34
35
36 /***
37 * @see RuntimeException#RuntimeException(Throwable)
38 */
39 public NoPackagesFoundException(final Throwable cause) {
40 super("no packages found", cause);
41 }
42
43
44 /***
45 * @see RuntimeException#RuntimeException(String)
46 */
47 public NoPackagesFoundException(final String path) {
48 super("source directory '{0}' does not exist or can not be found"
49 .replaceAll("//{0}", path.replaceAll("////", "/")));
50 }
51
52
53 /***
54 * @see RuntimeException#RuntimeException(String,Throwable)
55 */
56 public NoPackagesFoundException(final String message,
57 final Throwable cause) {
58 super(message, cause);
59 }
60 }