test_class.declarator: VALID_SESSION_ID = "sessionidsjdfhgskldjfsghldkfjsgg"
test_class.modifier: private static final
test_class.original_string: private static final String VALID_SESSION_ID = "sessionidsjdfhgskldjfsghldkfjsgg";
test_class.type: String
test_class.var_name: VALID_SESSION_ID
test_class.declarator: ILLEGAL_SESSION_ID = "////////////////////////////////"
test_class.modifier: private static final
test_class.original_string: private static final String ILLEGAL_SESSION_ID = "////////////////////////////////";
test_class.type: String
test_class.var_name: ILLEGAL_SESSION_ID
test_class.declarator: fileSessionStorage
test_class.modifier: private static
test_class.original_string: private static FileSessionStorage fileSessionStorage;
test_class.type: FileSessionStorage
test_class.var_name: fileSessionStorage
test_class.declarator: workingDirectory
test_class.modifier: private static
test_class.original_string: private static String workingDirectory;
test_class.type: String
test_class.var_name: workingDirectory
test_class.file: http/src/test/java/ro/polak/http/session/storage/FileSessionStorageTest.java
test_class.identifier: FileSessionStorageTest
test_case.body: @Test
      public void shouldReturnNullOnInvalidSessionName() throws IOException {
          assertThat(fileSessionStorage.getSession(null), is(nullValue()));
          assertThat(fileSessionStorage.getSession("abcX8"), is(nullValue()));
          assertThat(fileSessionStorage.getSession("/asdfghjklzxasdfghjklzxasdfghjklzxz"), is(nullValue()));
      }
test_case.class_method_signature: FileSessionStorageTest.shouldReturnNullOnInvalidSessionName()
test_case.full_signature: @Test public void shouldReturnNullOnInvalidSessionName()
test_case.identifier: shouldReturnNullOnInvalidSessionName
test_case.invocations: assertThat getSession is nullValue assertThat getSession is nullValue assertThat getSession is nullValue
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void shouldReturnNullOnInvalidSessionName()
focal_class.declarator: LOGGER = Logger.getLogger(FileSessionStorage.class.getName())
focal_class.modifier: private static final
focal_class.original_string: private static final Logger LOGGER = Logger.getLogger(FileSessionStorage.class.getName());
focal_class.type: Logger
focal_class.var_name: LOGGER
focal_class.declarator: SESSION_FILE_SUFFIX = "_session"
focal_class.modifier: private static final
focal_class.original_string: private static final String SESSION_FILE_SUFFIX = "_session";
focal_class.type: String
focal_class.var_name: SESSION_FILE_SUFFIX
focal_class.declarator: SESSION_ID_PATTERN = Pattern.compile("[a-z]+")
focal_class.modifier: private static final
focal_class.original_string: private static final Pattern SESSION_ID_PATTERN = Pattern.compile("[a-z]+");
focal_class.type: Pattern
focal_class.var_name: SESSION_ID_PATTERN
focal_class.declarator: SESSION_ID_EXPECTED_LENGTH = 32
focal_class.modifier: private static final
focal_class.original_string: private static final int SESSION_ID_EXPECTED_LENGTH = 32;
focal_class.type: int
focal_class.var_name: SESSION_ID_EXPECTED_LENGTH
focal_class.declarator: tempPath
focal_class.modifier: private final
focal_class.original_string: private final String tempPath;
focal_class.type: String
focal_class.var_name: tempPath
focal_class.file: http/src/main/java/ro/polak/http/session/storage/FileSessionStorage.java
focal_class.identifier: FileSessionStorage
focal_class.interfaces: implements SessionStorage
focal_class.class_method_signature: FileSessionStorage.FileSessionStorage(final String tempPath)
focal_class.full_signature: public  FileSessionStorage(final String tempPath)
focal_class.identifier: FileSessionStorage
focal_class.modifiers: public
focal_class.parameters: (final String tempPath)
focal_class.signature:  FileSessionStorage(final String tempPath)
focal_class.class_method_signature: FileSessionStorage.persistSession(final HttpSessionImpl session)
focal_class.full_signature: @Override public void persistSession(final HttpSessionImpl session)
focal_class.identifier: persistSession
focal_class.modifiers: @Override public
focal_class.parameters: (final HttpSessionImpl session)
focal_class.return: void
focal_class.signature: void persistSession(final HttpSessionImpl session)
focal_class.class_method_signature: FileSessionStorage.getSession(final String id)
focal_class.full_signature: @Override public HttpSessionImpl getSession(final String id)
focal_class.identifier: getSession
focal_class.modifiers: @Override public
focal_class.parameters: (final String id)
focal_class.return: HttpSessionImpl
focal_class.signature: HttpSessionImpl getSession(final String id)
focal_class.class_method_signature: FileSessionStorage.isSessionIdValid(final String id)
focal_class.full_signature: private boolean isSessionIdValid(final String id)
focal_class.identifier: isSessionIdValid
focal_class.modifiers: private
focal_class.parameters: (final String id)
focal_class.return: boolean
focal_class.signature: boolean isSessionIdValid(final String id)
focal_class.class_method_signature: FileSessionStorage.removeSession(final HttpSessionImpl session)
focal_class.full_signature: @Override public boolean removeSession(final HttpSessionImpl session)
focal_class.identifier: removeSession
focal_class.modifiers: @Override public
focal_class.parameters: (final HttpSessionImpl session)
focal_class.return: boolean
focal_class.signature: boolean removeSession(final HttpSessionImpl session)
focal_class.class_method_signature: FileSessionStorage.readSession(final String id, final File file)
focal_class.full_signature: private HttpSessionImpl readSession(final String id, final File file)
focal_class.identifier: readSession
focal_class.modifiers: private
focal_class.parameters: (final String id, final File file)
focal_class.return: HttpSessionImpl
focal_class.signature: HttpSessionImpl readSession(final String id, final File file)
focal_class.class_method_signature: FileSessionStorage.writeSession(final HttpSessionImpl session, final File file)
focal_class.full_signature: private void writeSession(final HttpSessionImpl session, final File file)
focal_class.identifier: writeSession
focal_class.modifiers: private
focal_class.parameters: (final HttpSessionImpl session, final File file)
focal_class.return: void
focal_class.signature: void writeSession(final HttpSessionImpl session, final File file)
focal_class.class_method_signature: FileSessionStorage.getSessionStoragePath(final String id)
focal_class.full_signature: private String getSessionStoragePath(final String id)
focal_class.identifier: getSessionStoragePath
focal_class.modifiers: private
focal_class.parameters: (final String id)
focal_class.return: String
focal_class.signature: String getSessionStoragePath(final String id)
focal_method.body: @Override
      public HttpSessionImpl getSession(final String id) throws IOException {
          HttpSessionImpl session = null;
          if (isSessionIdValid(id)) {
              File file = new File(getSessionStoragePath(id));
  
              if (file.exists()) {
                  session = readSession(id, file);
              } else {
                  LOGGER.log(Level.FINE, "Session file does not exist {0} under {1}",
                          new Object[]{id, tempPath});
              }
          }
  
          return session;
      }
focal_method.class_method_signature: FileSessionStorage.getSession(final String id)
focal_method.full_signature: @Override public HttpSessionImpl getSession(final String id)
focal_method.identifier: getSession
focal_method.invocations: isSessionIdValid getSessionStoragePath exists readSession log
focal_method.modifiers: @Override public
focal_method.parameters: (final String id)
focal_method.return: HttpSessionImpl
focal_method.signature: HttpSessionImpl getSession(final String id)