Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion TouchDB-Android - Help to understand TDServer.pathForName
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
bsquared  
View profile  
 More options Nov 13 2012, 4:40 pm
From: bsquared <bwcod...@gmail.com>
Date: Tue, 13 Nov 2012 13:40:41 -0800 (PST)
Local: Tues, Nov 13 2012 4:40 pm
Subject: TouchDB-Android - Help to understand TDServer.pathForName

Hello,

I am trying to figure out this block of code, but it escapes me.
https://github.com/couchbaselabs/TouchDB-Android/blob/master/TouchDB-...

I am not sure what the regular expression statement is supposed to do.  I
ran it through Regex::Explain the output is https://gist.github.com/4068456.
  public static final String LEGAL_CHARACTERS =
"abcdefghijklmnopqrstuvwxyz0123456789_$()+-/";
  if((name == null) || (name.length() == 0) || Pattern.matches("^" +
LEGAL_CHARACTERS, name) || !Character.isLowerCase(name.charAt(0))) {
            return null;
        }
What value would cause the statement to return true and thus return null
from the method?

Additionally, what name scenario would have slashes to replace with colon?

  name = name.replace('/', ':')

If someone could point me in the right direction I would appreciate it.  I am considering a desktop version, and
I want to write tests for these statements.

Thank you.

Regards,
Brian


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.