Commits

Mihai Glonț committed 29f13f6

Relaxed naming conventions for RepositoryFiles, fixing Issue #9.

See https://bitbucket.org/jummp/jummp/issue/9/

  • Participants
  • Parent commits c3f1307

Comments (0)

Files changed (1)

File grails-app/domain/net/biomodels/jummp/model/RepositoryFile.groovy

     String mimeType
 
     static constraints = {
-        path(blank: false, /*unique: true,*/
-            validator: { p, rf -> 
+        path(blank: false,
+            validator: { p, rf ->
                 String sep  = File.separator
-                String pathRegex = "${sep}?([a-zA-Z0-9\\-_]+${sep})+[a-zA-Z0-9\\-_\\.]+".toString()
-                if (p == null || !new File(p).exists() || ! p.matches(pathRegex)) {
+                if (p == null || !new File(p).exists()) {
                     return false
-                } 
+                }
                 def f = new File(p).getCanonicalFile()
                 def sherlock = new DefaultDetector()
                 String properType = sherlock.detect(new BufferedInputStream(