-
Notifications
You must be signed in to change notification settings - Fork 570
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
upstream: b=main,r=ae9113926f7ee00a3ff6d0ffaf832b93313957aa,t=2024-01…
…-12-1342-44199
- Loading branch information
1 parent
f7f2622
commit ac2016a
Showing
119 changed files
with
1,988 additions
and
8,497 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
72 changes: 72 additions & 0 deletions
72
...is/src/main/java/org/sonatype/nexus/datastore/mybatis/handlers/TokenizingTypeHandler.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
/* | ||
* Sonatype Nexus (TM) Open Source Version | ||
* Copyright (c) 2008-present Sonatype, Inc. | ||
* All rights reserved. Includes the third-party code listed at http://links.sonatype.com/products/nexus/oss/attributions. | ||
* | ||
* This program and the accompanying materials are made available under the terms of the Eclipse Public License Version 1.0, | ||
* which accompanies this distribution and is available at http://www.eclipse.org/legal/epl-v10.html. | ||
* | ||
* Sonatype Nexus (TM) Professional Version is available from Sonatype, Inc. "Sonatype" and "Sonatype Nexus" are trademarks | ||
* of Sonatype, Inc. Apache Maven is a trademark of the Apache Software Foundation. M2eclipse is a trademark of the | ||
* Eclipse Foundation. All other trademarks are the property of their respective owners. | ||
*/ | ||
package org.sonatype.nexus.datastore.mybatis.handlers; | ||
|
||
import java.sql.CallableStatement; | ||
import java.sql.PreparedStatement; | ||
import java.sql.ResultSet; | ||
import java.sql.SQLException; | ||
import java.util.Collection; | ||
import java.util.stream.Collectors; | ||
|
||
import com.google.common.collect.Iterables; | ||
import org.apache.ibatis.type.BaseTypeHandler; | ||
import org.apache.ibatis.type.JdbcType; | ||
|
||
/** | ||
* Simplistic tokenizer which splits strings using the following characters: . - / | ||
*/ | ||
public class TokenizingTypeHandler | ||
extends BaseTypeHandler<Collection<String>> | ||
{ | ||
private static final String SEPARATOR = " "; | ||
|
||
@Override | ||
public void setNonNullParameter( | ||
final PreparedStatement ps, | ||
final int parameterIndex, | ||
final Collection<String> parameter, | ||
final JdbcType jdbcType) throws SQLException | ||
{ | ||
ps.setString(parameterIndex, tokenize(toString(parameter))); | ||
} | ||
|
||
private static String tokenize(final String token) { | ||
return token.replaceAll("[.-/]", SEPARATOR); | ||
} | ||
|
||
private static String toString(final Collection<String> values) { | ||
if (values.isEmpty()) { | ||
return ""; | ||
} | ||
else if (values.size() == 1) { | ||
return Iterables.getOnlyElement(values); | ||
} | ||
return values.stream().collect(Collectors.joining(SEPARATOR)); | ||
} | ||
|
||
@Override | ||
public Collection<String> getNullableResult(final ResultSet rs, final String columnName) throws SQLException { | ||
throw new UnsupportedOperationException(); | ||
} | ||
|
||
@Override | ||
public Collection<String> getNullableResult(final ResultSet rs, final int columnIndex) throws SQLException { | ||
throw new UnsupportedOperationException(); | ||
} | ||
|
||
@Override | ||
public Collection<String> getNullableResult(final CallableStatement cs, final int columnIndex) throws SQLException { | ||
throw new UnsupportedOperationException(); | ||
} | ||
} |
168 changes: 0 additions & 168 deletions
168
...-content/src/main/java/org/sonatype/nexus/repository/content/search/SearchResultData.java
This file was deleted.
Oops, something went wrong.
59 changes: 0 additions & 59 deletions
59
...content/src/main/java/org/sonatype/nexus/repository/content/search/SearchViewColumns.java
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.