summaryrefslogtreecommitdiff
path: root/src/cuchaz/enigma/ClassFile.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/cuchaz/enigma/ClassFile.java')
-rw-r--r--src/cuchaz/enigma/ClassFile.java45
1 files changed, 45 insertions, 0 deletions
diff --git a/src/cuchaz/enigma/ClassFile.java b/src/cuchaz/enigma/ClassFile.java
new file mode 100644
index 0000000..221a119
--- /dev/null
+++ b/src/cuchaz/enigma/ClassFile.java
@@ -0,0 +1,45 @@
1/*******************************************************************************
2 * Copyright (c) 2014 Jeff Martin.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the GNU Public License v3.0
5 * which accompanies this distribution, and is available at
6 * http://www.gnu.org/licenses/gpl.html
7 *
8 * Contributors:
9 * Jeff Martin - initial API and implementation
10 ******************************************************************************/
11package cuchaz.enigma;
12
13import java.util.regex.Pattern;
14
15public class ClassFile
16{
17 private static Pattern m_obfuscatedClassPattern;
18
19 static
20 {
21 m_obfuscatedClassPattern = Pattern.compile( "^[a-z]+$" );
22 }
23
24 private String m_name;
25
26 public ClassFile( String name )
27 {
28 m_name = name;
29 }
30
31 public String getName( )
32 {
33 return m_name;
34 }
35
36 public boolean isObfuscated( )
37 {
38 return m_obfuscatedClassPattern.matcher( m_name ).matches();
39 }
40
41 public String getPath( )
42 {
43 return m_name.replace( ".", "/" ) + ".class";
44 }
45}