public synchronized InputStream obtainFile(String sessionID, String source, String fileName) throws IOException {ensureOpen();ReplicationSession session = sessions.get(sessionID);if (session != null && session.isExpired(expirationThresholdMilllis)) {releaseSession(sessionID);session = null;}if (session == null) {throw new SessionExpiredException("session (" + sessionID + ") expired while obtaining file: source=" + source+ " file=" + fileName);}sessions.get(sessionID).markAccessed();return session.revision.revision.open(source, fileName);}

public synchronized InputStream obtainFile ( String sessionID , String source , String fileName ) throws IOException { ensureOpen ( ) ; ReplicationSession session = sessions . get ( sessionID ) ; if ( session != null && session . isExpired ( expirationThresholdMilllis ) ) { releaseSession ( sessionID ) ; session = null ; } if ( session == null ) { throw new SessionExpiredException ( "session (" + sessionID + ") expired while obtaining file: source=" + source + " file=" + fileName ) ; } sessions . get ( sessionID ) . markAccessed ( ) ; return session . revision . revision . open ( source , fileName ) ; }
public virtual Stream ObtainFile(string sessionId, string source, string fileName){lock (padlock){EnsureOpen();ReplicationSession session;if (sessions.TryGetValue(sessionId, out session) && session != null && session.IsExpired(ExpirationThreshold)){ReleaseSession(sessionId);session = null;}if (session == null){throw new SessionExpiredException(string.Format("session ({0}) expired while obtaining file: source={1} file={2}", sessionId, source, fileName));}sessions[sessionId].MarkAccessed();return session.Revision.Revision.Open(source, fileName);}}
