Revision d0082e93
Added by Andreas Müller over 15 years ago
.gitattributes | ||
---|---|---|
12 | 12 |
cdmlib-commons/README.TXT -text |
13 | 13 |
cdmlib-commons/pom.xml -text |
14 | 14 |
cdmlib-commons/src/main/java/eu/etaxonomy/cdm/common/CdmUtils.java -text |
15 |
cdmlib-commons/src/main/java/eu/etaxonomy/cdm/common/UuidGenerator.java -text |
|
16 | 15 |
cdmlib-commons/src/main/java/eu/etaxonomy/cdm/common/XmlHelp.java -text |
17 | 16 |
cdmlib-commons/src/main/resources/MUST-EXIST.txt -text |
18 | 17 |
cdmlib-commons/src/main/resources/log4j.properties -text |
19 | 18 |
cdmlib-commons/src/site/site.xml -text |
20 | 19 |
cdmlib-commons/src/test/java/eu/etaxonomy/cdm/common/CdmUtilsTest.java -text |
20 |
cdmlib-commons/src/test/java/eu/etaxonomy/cdm/common/UuidGenerator.java -text |
|
21 | 21 |
cdmlib-commons/src/test/java/eu/etaxonomy/cdm/common/XmlHelpTest.java -text |
22 | 22 |
cdmlib-commons/src/test/java/eu/etaxonomy/cdm/test/suite/CdmTestSuite.java -text |
23 | 23 |
cdmlib-commons/src/test/java/eu/etaxonomy/cdm/test/unit/CdmUnitTestBase.java -text |
cdmlib-commons/src/main/java/eu/etaxonomy/cdm/common/CdmUtils.java | ||
---|---|---|
13 | 13 |
import java.io.File; |
14 | 14 |
import java.io.IOException; |
15 | 15 |
import java.io.InputStream; |
16 |
import java.net.MalformedURLException; |
|
16 | 17 |
import java.net.URL; |
17 | 18 |
|
18 | 19 |
import org.apache.log4j.Logger; |
... | ... | |
150 | 151 |
return concat(seperator, strings); |
151 | 152 |
} |
152 | 153 |
|
154 |
static public boolean urlExists(String strUrl, boolean withWarning){ |
|
155 |
try { |
|
156 |
URL url = new URL(strUrl); |
|
157 |
url.getContent(); |
|
158 |
return true; |
|
159 |
} catch (MalformedURLException e) { |
|
160 |
if (withWarning) { |
|
161 |
logger.warn(e); |
|
162 |
} |
|
163 |
} catch (IOException e) { |
|
164 |
// |
|
165 |
}; |
|
166 |
return false; |
|
167 |
} |
|
168 |
|
|
169 |
|
|
153 | 170 |
} |
cdmlib-commons/src/main/java/eu/etaxonomy/cdm/common/UuidGenerator.java | ||
---|---|---|
1 |
/** |
|
2 |
* Copyright (C) 2007 EDIT |
|
3 |
* European Distributed Institute of Taxonomy |
|
4 |
* http://www.e-taxonomy.eu |
|
5 |
* |
|
6 |
* The contents of this file are subject to the Mozilla Public License Version 1.1 |
|
7 |
* See LICENSE.TXT at the top of this package for the full license terms. |
|
8 |
*/ |
|
9 |
package eu.etaxonomy.cdm.common; |
|
10 |
|
|
11 |
import java.util.UUID; |
|
12 |
|
|
13 |
/** |
|
14 |
* |
|
15 |
* @author a.mueller |
|
16 |
*/ |
|
17 |
public class UuidGenerator { |
|
18 |
|
|
19 |
/** |
|
20 |
* @param args |
|
21 |
*/ |
|
22 |
public static void main(String[] args) { |
|
23 |
for (int i = 0; i < 10; i++){ |
|
24 |
System.out.println(UUID.randomUUID()); |
|
25 |
} |
|
26 |
|
|
27 |
} |
|
28 |
|
|
29 |
} |
cdmlib-commons/src/test/java/eu/etaxonomy/cdm/common/UuidGenerator.java | ||
---|---|---|
1 |
/** |
|
2 |
* Copyright (C) 2007 EDIT |
|
3 |
* European Distributed Institute of Taxonomy |
|
4 |
* http://www.e-taxonomy.eu |
|
5 |
* |
|
6 |
* The contents of this file are subject to the Mozilla Public License Version 1.1 |
|
7 |
* See LICENSE.TXT at the top of this package for the full license terms. |
|
8 |
*/ |
|
9 |
package eu.etaxonomy.cdm.common; |
|
10 |
|
|
11 |
import java.util.UUID; |
|
12 |
|
|
13 |
/** |
|
14 |
* |
|
15 |
* @author a.mueller |
|
16 |
*/ |
|
17 |
public class UuidGenerator { |
|
18 |
|
|
19 |
/** |
|
20 |
* @param args |
|
21 |
*/ |
|
22 |
public static void main(String[] args) { |
|
23 |
for (int i = 0; i < 10; i++){ |
|
24 |
System.out.println(UUID.randomUUID()); |
|
25 |
} |
|
26 |
|
|
27 |
|
|
28 |
} |
|
29 |
|
|
30 |
} |
Also available in: Unified diff